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