Version: v0.1.0 Latest Latest

This package is not in the latest version of its module.

Go to latest
Published: Mar 26, 2018 License: BSD-2-Clause Imports: 4 Imported by: 0



Package version provides a home for metadata about the program, how it's running, what it's name is, and so forth. It should not depend upon any non-stdlib packages, so that it's safe for import anywhere in the project.



View Source
const Program = "dummyapp"

Program is our idea of the persistent name of the program, for use where we don't want to use argv[0]. It's exported so that this doesn't have to be repeated. Customize this if copying this code for use elsewhere!


View Source
var BuildTime string

BuildTime is potentially set at link-time. It should be used to record the timestamp (date+time) of the build.


func CurrentVersion

func CurrentVersion() string

CurrentVersion provides the single-string derivation of what we consider our current version to be. It might be derived from multiple pieces of information, whatever we think makes sense. It probably fits on one line.

func PrintTo added in v0.0.5

func PrintTo(w io.Writer)

PrintTo is used to write multiple whole lines of version information to an io.Writer. Contrast with LogPairs.


type LogPair added in v0.0.3

type LogPair struct {
	Key, Value string

A LogPair is a simple Key,Value pair of strings, suitable for using in structured logging as one item.

func LogPairs added in v0.0.3

func LogPairs() []LogPair

LogPairs returns a slice of items suitable for logging. It's roughly equivalent to PrintTo, but it's the caller's responsibility to iterate the slice and add each pair to the logging call.

Source Files

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL