Add CGO hint in version cmd (#12)

This commit is contained in:
Hellojack 2022-08-12 15:46:26 +08:00 committed by GitHub
parent b0ed1dc106
commit f8d13d79c7
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -18,5 +18,10 @@ var commandVersion = &cobra.Command{
} }
func printVersion(cmd *cobra.Command, args []string) { func printVersion(cmd *cobra.Command, args []string) {
os.Stderr.WriteString(F.ToString("sing-box version ", C.Version, " (", runtime.Version(), " ", runtime.GOOS, "/", runtime.GOARCH, ")\n")) os.Stderr.WriteString(F.ToString("sing-box version ", C.Version, " (", runtime.Version(), ", ", runtime.GOOS, "/", runtime.GOARCH, ", CGO "))
if C.CGO_ENABLED {
os.Stderr.WriteString("enabled)\n")
} else {
os.Stderr.WriteString("disabled)\n")
}
} }