Documentation
¶
Overview ¶
Package buildinfo resolves the git revision and dirty state of the running binary: from Go's embedded VCS stamps when available, otherwise from ldflags-injected variables or environment variables.
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( Revision string DirtyFlag string )
Injectable via:
go build -ldflags "-X github.com/ekusiadadus/isutools/buildinfo.Revision=$(git rev-parse HEAD) \
-X github.com/ekusiadadus/isutools/buildinfo.DirtyFlag=$(test -n "$(git status --porcelain)" && echo dirty)"
Functions ¶
This section is empty.
Types ¶
type Info ¶
type Info struct {
Revision string `json:"revision"`
Dirty bool `json:"dirty"`
Source string `json:"source"` // vcs | ldflags | env | unknown
}
Info describes the resolved build revision.
Click to show internal directories.
Click to hide internal directories.