Documentation
¶
Index ¶
- Constants
- Variables
- func HardCodedPkgID(pkgpath string) int
- func Round4(x int) int
- type CounterFileFooter
- type CounterFileHeader
- type CounterFlavor
- type CounterGranularity
- type CounterMode
- type CounterSegmentHeader
- type CoverFixupConfig
- type CoverPkgConfig
- type CoverableUnit
- type FuncDesc
- type MetaFileCollection
- type MetaFileHeader
- type MetaSymbolHeader
Constants ¶
const CounterFilePref = "covcounters"
CounterFilePref is the file prefix used when emitting coverage data output files. CounterFileTemplate describes the format of the file name: prefix followed by meta-file hash followed by process ID followed by emit UnixNanoTime.
const CounterFileRegexp = `^%s\.(\S+)\.(\d+)\.(\d+)+$`
const CounterFileTempl = "%s.%x.%d.%d"
const CounterFileVersion = 1
CounterFileVersion stores the most recent counter data file version.
const CovMetaHeaderSize = 16 + 4 + 4 + 4 + 4 + 4 + 4 + 4 // keep in sync with above
const FirstCtrOffset = 3
const FuncIdOffset = 2
const MetaFilePref = "covmeta"
MetaFilePref is a prefix used when emitting meta-data files; these files are of the form "covmeta.<hash>", where hash is a hash computed from the hashes of all the package meta-data symbols in the program.
const MetaFileVersion = 1
MetaFileVersion contains the current (most recent) meta-data file version.
const MetaFilesFileName = "metafiles.txt"
Name of file within the "go test -cover" temp coverdir directory containing a list of meta-data files for packages being tested in a "go test -coverpkg=... ..." run. This constant is shared by the Go command and by the coverage runtime.
const NotHardCoded = -1
NotHardCoded is a package pseudo-ID indicating that a given package is not part of the runtime and doesn't require a hard-coded ID.
const NumCtrsOffset = 0
const PkgIdOffset = 1
Variables ¶
var CovCounterMagic = [4]byte{'\x00', '\x63', '\x77', '\x6d'}
CovCounterMagic holds the magic string for a coverage counter-data file.
var CovMetaMagic = [4]byte{'\x00', '\x63', '\x76', '\x6d'}
CovMetaMagic holds the magic string for a meta-data file.
Functions ¶
func HardCodedPkgID ¶
HardCodedPkgID returns the hard-coded ID for the specified package path, or -1 if we don't use a hard-coded ID. Hard-coded IDs start at -2 and decrease as we go down the list.