From f8d13d79c77d3ab51e950b1a7678c01976fe7a51 Mon Sep 17 00:00:00 2001 From: Hellojack <106379370+H1JK@users.noreply.github.com> Date: Fri, 12 Aug 2022 15:46:26 +0800 Subject: [PATCH] Add CGO hint in version cmd (#12) --- cmd/sing-box/cmd_version.go | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/cmd/sing-box/cmd_version.go b/cmd/sing-box/cmd_version.go index 99ce25d0..6327d814 100644 --- a/cmd/sing-box/cmd_version.go +++ b/cmd/sing-box/cmd_version.go @@ -18,5 +18,10 @@ var commandVersion = &cobra.Command{ } 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") + } }