mirror of
https://codeberg.org/scip/esctl.git
synced 2026-08-24 20:44:19 +02:00
adopt latest golang enhancements (#91)
This commit is contained in:
13
cmd/root.go
13
cmd/root.go
@@ -21,6 +21,7 @@ import (
|
||||
"fmt"
|
||||
golog "log"
|
||||
"os"
|
||||
"runtime/debug"
|
||||
"runtime/pprof"
|
||||
"strings"
|
||||
|
||||
@@ -118,6 +119,12 @@ func Main() int {
|
||||
Usage: "enable HTTP debugging",
|
||||
Destination: &conf.DebugHTTP,
|
||||
},
|
||||
&cli.BoolFlag{
|
||||
Name: "debug-goroutines",
|
||||
Value: false,
|
||||
Usage: "enable goroutine debugging",
|
||||
Destination: &conf.DebugGoRoutines,
|
||||
},
|
||||
&cli.BoolFlag{
|
||||
Name: "align-ints",
|
||||
Aliases: []string{"I"},
|
||||
@@ -253,6 +260,12 @@ func Version(conf *cfg.Config) *cli.Command {
|
||||
Usage: "show esctl version information",
|
||||
|
||||
Action: func(ctx context.Context, cmd *cli.Command) error {
|
||||
info, _ := debug.ReadBuildInfo()
|
||||
|
||||
if strings.Contains(info.Main.Version, "+dirty") {
|
||||
cfg.COMMIT += "+dirty"
|
||||
}
|
||||
|
||||
_, err := fmt.Printf(versionFmt,
|
||||
cfg.Version, cfg.BUILD, cfg.BRANCH, cfg.COMMIT, cfg.GOVERSION, cfg.APIVERSION)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user