Restore config loading, keep exported Version, keep cgo off
Bring back the in-progress viper and go-homedir configuration loading from the original root command as a persistent pre-run on the root command, with a --config flag and a config line in sutil info. Restore the exported main.Version with a nolint directive instead of renaming it. Export CGO_ENABLED=0 from the Makefile, drop -race from make test, and remove the C toolchain from the Docker builder stage.
This commit is contained in:
+6
-4
@@ -8,12 +8,14 @@ import (
|
||||
"sneak.berlin/go/x/internal/cli"
|
||||
)
|
||||
|
||||
// version is the build version. The Makefile and Dockerfile set it at link
|
||||
// time with -ldflags "-X main.version=...".
|
||||
var version = "dev"
|
||||
// Version is the build version. The Makefile and Dockerfile set it at link
|
||||
// time with -ldflags "-X main.Version=...".
|
||||
//
|
||||
//nolint:gochecknoglobals // set by the linker; there is no other way
|
||||
var Version = "dev"
|
||||
|
||||
func main() {
|
||||
err := cli.New(cli.Params{Version: version}).Execute()
|
||||
err := cli.New(cli.Params{Version: Version, ConfigDir: ""}).Execute()
|
||||
if err != nil {
|
||||
os.Exit(1)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user