Emmanuel BENOîT
3b7757b1d9
This PR seeks to solve #2. It adds a Makefile that can build, test, lint and package the code and the Forgejo workflows needed to automate the build. In addition, it resolves various issues highlighted by the linter. Reviewed-on: #5 Co-authored-by: Emmanuel BENOÎT <tseeker@nocternity.net> Co-committed-by: Emmanuel BENOÎT <tseeker@nocternity.net>
27 lines
379 B
Go
27 lines
379 B
Go
package main
|
|
|
|
import "fmt"
|
|
|
|
var (
|
|
version = ""
|
|
commit = "unknown"
|
|
status = ""
|
|
target = "unknown/unknown"
|
|
)
|
|
|
|
func versionString() string {
|
|
var schar, ver string
|
|
if status == "dirty" {
|
|
schar = "*"
|
|
} else {
|
|
schar = ""
|
|
}
|
|
|
|
if version == "" {
|
|
ver = "development version"
|
|
} else {
|
|
ver = version
|
|
}
|
|
|
|
return fmt.Sprintf("%s (%s%s) %s", ver, commit, schar, target)
|
|
}
|