Source File
buildinfo.go
Belonging Package
go.pact.im/x/maininfo
package maininfo
import (
)
var (
modOnce sync.Once
modPath string
modVersion string
)
func () {
, := debug.ReadBuildInfo()
if ! {
return
}
:= .Main
if := .Replace; != nil {
= *
}
modPath, modVersion = .Path, .Version
}
// Path returns main module’s path. It returns an empty string if an executable
// was built without module support.
//
// If the main module is replaced by another module, it returns the path of that
// module.
func () string {
modOnce.Do(readBuildInfo)
return modPath
}
// Version returns main module’s version. It returns an empty string if an
// executable was built without module support.
//
// If the main module is replaced by another module, it returns the version of
// that module.
func () string {
modOnce.Do(readBuildInfo)
return modVersion
}
The pages are generated with Golds v0.4.9. (GOOS=linux GOARCH=amd64)