buildinfo.go 225 B

1234567891011121314
  1. // +build go1.12
  2. package cmdflag
  3. import (
  4. "runtime/debug"
  5. )
  6. func buildinfo() string {
  7. if bi, ok := debug.ReadBuildInfo(); ok {
  8. return bi.Main.Version
  9. }
  10. return "no version available (not built with module support)"
  11. }