github.com/lusis/distribution@v2.0.1+incompatible/version/print.go (about) 1 package version 2 3 import ( 4 "fmt" 5 "io" 6 "os" 7 ) 8 9 // FprintVersion outputs the version string to the writer, in the following 10 // format, followed by a newline: 11 // 12 // <cmd> <project> <version> 13 // 14 // For example, a binary "registry" built from github.com/docker/distribution 15 // with version "v2.0" would print the following: 16 // 17 // registry github.com/docker/distribution v2.0 18 // 19 func FprintVersion(w io.Writer) { 20 fmt.Fprintln(w, os.Args[0], Package, Version) 21 } 22 23 // PrintVersion outputs the version information, from Fprint, to stdout. 24 func PrintVersion() { 25 FprintVersion(os.Stdout) 26 }