Skip to content

Commit

Permalink
feat: version print build settings
Browse files Browse the repository at this point in the history
  • Loading branch information
zijiren233 committed Nov 20, 2024
1 parent 2892f14 commit c4d9cc1
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions cmd/version.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ package cmd
import (
"fmt"
"runtime"
"runtime/debug"

"github.com/spf13/cobra"
"github.com/synctv-org/synctv/internal/version"
Expand All @@ -20,6 +21,11 @@ var VersionCmd = &cobra.Command{
fmt.Printf("- os/arch: %s\n", runtime.GOARCH)
fmt.Printf("- go/version: %s\n", runtime.Version())
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)
}
},
}

Expand Down

0 comments on commit c4d9cc1

Please sign in to comment.