diff options
Diffstat (limited to 'src/testing')
| -rw-r--r-- | src/testing/newcover.go | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/src/testing/newcover.go b/src/testing/newcover.go index 6199f3bd7b..7a70dcfffa 100644 --- a/src/testing/newcover.go +++ b/src/testing/newcover.go @@ -10,6 +10,7 @@ import ( "fmt" "internal/goexperiment" "os" + _ "unsafe" // for linkname ) // cover2 variable stores the current coverage mode and a @@ -20,6 +21,9 @@ var cover2 struct { snapshotcov func() float64 } +// registerCover2 is injected in testmain. +//go:linkname registerCover2 + // registerCover2 is invoked during "go test -cover" runs by the test harness // code in _testmain.go; it is used to record a 'tear down' function // (to be called when the test is complete) and the coverage mode. @@ -42,6 +46,9 @@ func coverReport2() { } } +// testGoCoverDir is used in runtime/coverage tests. +//go:linkname testGoCoverDir + // testGoCoverDir returns the value passed to the -test.gocoverdir // flag by the Go command, if goexperiment.CoverageRedesign is // in effect. |
