Discover Packages
github.com/micromdm/go4
version
package
Version:
v0.0.0-...-908f275
Opens a new window with list of versions in this module.
Published: Feb 15, 2024
License: MIT
Opens a new window with license information.
Imports: 3
Opens a new window with list of imports.
Imported by: 5
Opens a new window with list of known importers.
Documentation
Documentation
¶
Package version provides utilities for displaying version information about a Go application.
To use this package, a program would set the package variables at build time, using the
-ldflags go build flag.
Example:
go build -ldflags "-X github.com/micromdm/go4/version.version=1.0.0"
Available values and defaults to use with ldflags:
version = "unknown"
branch = "unknown"
revision = "unknown"
goVersion = "unknown"
buildDate = "unknown"
buildUser = "unknown"
appName = "unknown"
Handler provides an HTTP Handler which returns JSON formatted version info.
Print outputs the app name and version string.
PrintFull outputs the app name and detailed version information.
type Info struct {
Version string `json:"version"`
Branch string `json:"branch"`
Revision string `json:"revision"`
GoVersion string `json:"go_version"`
BuildDate string `json:"build_date"`
BuildUser string `json:"build_user"`
}
Info holds version and build info about the app.
Version returns a struct with the current version information.
Source Files
¶
Click to show internal directories.
Click to hide internal directories.