diff options
author | Matt Holt <mholt@users.noreply.github.com> | 2022-08-04 11:16:59 -0600 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-08-04 11:16:59 -0600 |
commit | 17ae5acaba536e98cfa86ddcd6967801f1fa1bbe (patch) | |
tree | fab5bd3d28ad46e14bb8916b95059de816db75ec /cmd/commandfuncs.go | |
parent | 1960a0dc117dd30fb507b390ddf93b2ef371b9ad (diff) |
cmd: Use newly-available version information (#4931)
Diffstat (limited to 'cmd/commandfuncs.go')
-rw-r--r-- | cmd/commandfuncs.go | 21 |
1 files changed, 4 insertions, 17 deletions
diff --git a/cmd/commandfuncs.go b/cmd/commandfuncs.go index a4b7bdf..67015f7 100644 --- a/cmd/commandfuncs.go +++ b/cmd/commandfuncs.go @@ -331,30 +331,17 @@ func cmdReload(fl Flags) (int, error) { } func cmdVersion(_ Flags) (int, error) { - fmt.Println(CaddyVersion()) + _, full := caddy.Version() + fmt.Println(full) return caddy.ExitCodeSuccess, nil } -func cmdBuildInfo(fl Flags) (int, error) { +func cmdBuildInfo(_ Flags) (int, error) { bi, ok := debug.ReadBuildInfo() if !ok { return caddy.ExitCodeFailedStartup, fmt.Errorf("no build information") } - - fmt.Printf("go_version: %s\n", runtime.Version()) - fmt.Printf("go_os: %s\n", runtime.GOOS) - fmt.Printf("go_arch: %s\n", runtime.GOARCH) - fmt.Printf("path: %s\n", bi.Path) - fmt.Printf("main: %s %s %s\n", bi.Main.Path, bi.Main.Version, bi.Main.Sum) - fmt.Println("dependencies:") - - for _, goMod := range bi.Deps { - fmt.Printf("%s %s %s", goMod.Path, goMod.Version, goMod.Sum) - if goMod.Replace != nil { - fmt.Printf(" => %s %s %s", goMod.Replace.Path, goMod.Replace.Version, goMod.Replace.Sum) - } - fmt.Println() - } + fmt.Println(bi) return caddy.ExitCodeSuccess, nil } |