GoTomato/internal/metadata/version.go

24 lines
380 B
Go
Raw Normal View History

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