Compare commits

..

2 commits

4 changed files with 17 additions and 9 deletions

View file

@ -1,4 +1,5 @@
# vim: set ts=2 sw=2 tw=0 fo=cnqoj
# yaml-language-server: $schema=https://goreleaser.com/static/schema.json
version: 2

View file

@ -1,3 +1,4 @@
# yaml-language-server: $schema=https://taskfile.dev/schema.json
version: '3'
vars:

View file

@ -1,16 +1,23 @@
package metadata
import (
"os"
"fmt"
"runtime/debug"
"strings"
)
func getVersion() string {
content, _ := os.ReadFile("version.txt")
version := strings.TrimSpace(string(content))
var (
GoTomatoVersion = "" // The GoTomato version
ProtocolVersion = "" // The protocol version
)
return version
func init() {
info, ok := debug.ReadBuildInfo()
fmt.Printf("%v", info)
if !ok {
GoTomatoVersion = "unknown"
}
GoTomatoVersion = info.Main.Version
ProtocolVersion = strings.Split(GoTomatoVersion, ".")[0]
}
var GoTomatoVersion = getVersion() // The GoTomato version
var ProtocolVersion = strings.Split(GoTomatoVersion, ".")[0] // The protocol version

View file

@ -1 +0,0 @@
devel