feat: version print build settings

pull/232/merge
zijiren233 3 months ago
parent 2892f1475f
commit c4d9cc1a8d

@ -3,6 +3,7 @@ package cmd
import ( import (
"fmt" "fmt"
"runtime" "runtime"
"runtime/debug"
"github.com/spf13/cobra" "github.com/spf13/cobra"
"github.com/synctv-org/synctv/internal/version" "github.com/synctv-org/synctv/internal/version"
@ -20,6 +21,11 @@ var VersionCmd = &cobra.Command{
fmt.Printf("- os/arch: %s\n", runtime.GOARCH) fmt.Printf("- os/arch: %s\n", runtime.GOARCH)
fmt.Printf("- go/version: %s\n", runtime.Version()) fmt.Printf("- go/version: %s\n", runtime.Version())
fmt.Printf("- go/compiler: %s\n", runtime.Compiler) fmt.Printf("- go/compiler: %s\n", runtime.Compiler)
fmt.Printf("- go/numcpu: %d\n", runtime.NumCPU())
info, ok := debug.ReadBuildInfo()
if ok {
fmt.Printf("- go/buildsettings: %v\n", info.Settings)
}
}, },
} }

Loading…
Cancel
Save