go.astrophena.name/base Module
Base Go packages for my projects.
package version
import "go.astrophena.name/base/version"
Package version provides the version and build information.
Index
Functions
func CmdName
func CmdName() string
CmdName returns the base name of the current binary.
func UserAgent
func UserAgent() string
UserAgent returns a user agent string by combining the version information and a special URL leading to bot information page.
Types
type Info
type Info struct { Name string `json:"name"` // name of the program Version string `json:"version"` // BuildInfo's module version Commit string `json:"commit"` // BuildInfo's vcs.revision BuiltAt string `json:"built_at"` // BuildInfo's vcs.date Dirty bool `json:"dirty"` // BuildInfo's vcs.modified Go string `json:"go"` // runtime.Version() OS string `json:"os"` // runtime.GOOS Arch string `json:"arch"` // runtime.GOARCH }
Info is the version and build information of the current binary.
func Version
func Version() Info
Version returns the version and build information of the current binary.
func (Info) String
func (i Info) String() string
String implements the fmt.Stringer interface.