GoTomato/internal/metadata/version.go

23 lines
380 B
Go

package metadata
import (
"fmt"
"runtime/debug"
"strings"
)
var (
GoTomatoVersion = "" // The GoTomato version
ProtocolVersion = "" // The protocol version
)
func init() {
info, ok := debug.ReadBuildInfo()
fmt.Printf("%v", info)
if !ok {
GoTomatoVersion = "unknown"
}
GoTomatoVersion = info.Main.Version
ProtocolVersion = strings.Split(GoTomatoVersion, ".")[0]
}