mirror of
https://github.com/golang/go.git
synced 2025-12-08 06:10:04 +00:00
internal/coverage/cfile: remove more //go:linkname usage
Move code so that basic imports work instead of //go:linkname for metadata lists. For #67401. Change-Id: Id02075570befc45a9426559aad2137ab540928b2 Reviewed-on: https://go-review.googlesource.com/c/go/+/585915 Reviewed-by: Than McIntosh <thanm@google.com> LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com> Reviewed-by: Cherry Mui <cherryyz@google.com>
This commit is contained in:
parent
c96159c252
commit
df4e49366c
6 changed files with 111 additions and 112 deletions
|
|
@ -7,6 +7,7 @@ package cfile
|
|||
import (
|
||||
"fmt"
|
||||
"internal/coverage"
|
||||
"internal/coverage/rtcov"
|
||||
"io"
|
||||
"sync/atomic"
|
||||
"unsafe"
|
||||
|
|
@ -17,7 +18,7 @@ func WriteMetaDir(dir string) error {
|
|||
if !finalHashComputed {
|
||||
return fmt.Errorf("error: no meta-data available (binary not built with -cover?)")
|
||||
}
|
||||
return emitMetaDataToDirectory(dir, getCovMetaList())
|
||||
return emitMetaDataToDirectory(dir, rtcov.Meta.List)
|
||||
}
|
||||
|
||||
// WriteMeta implements [runtime/coverage.WriteMeta].
|
||||
|
|
@ -28,7 +29,7 @@ func WriteMeta(w io.Writer) error {
|
|||
if !finalHashComputed {
|
||||
return fmt.Errorf("error: no meta-data available (binary not built with -cover?)")
|
||||
}
|
||||
ml := getCovMetaList()
|
||||
ml := rtcov.Meta.List
|
||||
return writeMetaData(w, ml, cmode, cgran, finalHash)
|
||||
}
|
||||
|
||||
|
|
@ -57,7 +58,7 @@ func WriteCounters(w io.Writer) error {
|
|||
return fmt.Errorf("meta-data not written yet, unable to write counter data")
|
||||
}
|
||||
|
||||
pm := getCovPkgMap()
|
||||
pm := rtcov.Meta.PkgMap
|
||||
s := &emitState{
|
||||
counterlist: cl,
|
||||
pkgmap: pm,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue