Documentation
¶
Overview ¶
Package buildinfo stores information about an applications current build
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetRunNameForProgram ¶
func GetRunNameForProgram() string
GetRunNameForProgram returns the base name of the running program.
Types ¶
type Info ¶
type Info struct {
// BuiltBy who/what build this version.
BuiltBy string
// Date compiled.
Date string
// Commit used for build.
Commit string
// CompiledName compile name used for build.
CompiledName string
// RunName is the name of the program obtained from arg[0].
RunName string
// Version is the version of the program.
Version string
// Start dir is the working directory when the program starts.
StartDir string
}
Info is information about the build.
func GetBuildInfo ¶
GetBuildInfo returns the run context.
func NewInfo ¶
NewInfo creates a new info from the passed arguments. Use NewInfo to pass in the information captured from link flags.
Eg --ldflags "-s -w -X main.version={{ .Version }} -X main.commit={{ .Commit }} -X main.date={{ .CommitDate }} -X main.builtBy={{ .Env.BUILTBY }}".
func (Info) NewContext ¶
NewContext creates a new context containing the build information.
Click to show internal directories.
Click to hide internal directories.