16 lines
217 B
Go
16 lines
217 B
Go
package vcs
|
|
|
|
import (
|
|
"runtime/debug"
|
|
)
|
|
|
|
// Version returns the main module version from Go build metadata.
|
|
func Version() string {
|
|
bi, ok := debug.ReadBuildInfo()
|
|
if ok {
|
|
return bi.Main.Version
|
|
}
|
|
|
|
return ""
|
|
}
|