fetchcert/version.go
Emmanuel BENOîT 3b7757b1d9
All checks were successful
Run tests and linters / test (push) Successful in 42s
Run tests and linters / build (push) Successful in 41s
Run tests and linters / lint (push) Successful in 1m18s
chore: add support for build automation (#5)
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>
2024-07-26 14:07:46 +02:00

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)
}