package
Version:
v0.0.0-...-58998d9
Opens a new window with list of versions in this module.
Published: Oct 20, 2019
License: Apache-2.0
Opens a new window with license information.
Imports: 3
Opens a new window with list of imports.
Imported by: 0
Opens a new window with list of known importers.
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/etherlabsio/pkg/version.version=1.0.0"
Available values and defaults to use with ldflags:
version = "unknown"
branch = "unknown"
revision = "unknown"
goVersion = "unknown"
buildDate = "unknown"
appName = "unknown"
Handler returns an HTTP Handler which returns JSON formatted version information.
Print outputs the application name and version string.
PrintFull prints the application 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"`
}
Info is a structure with version build information about the current application.
Version returns a structure with the current version information.
Source Files
¶
Click to show internal directories.
Click to hide internal directories.