Skip to content

Commit

Permalink
feat: Add CGO hint to build information
Browse files Browse the repository at this point in the history
  • Loading branch information
layou233 committed Jan 8, 2023
1 parent d048866 commit b280393
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 2 deletions.
8 changes: 8 additions & 0 deletions common/cgo_disabled.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
//go:build !cgo

package common

const (
CGOEnabled = false
CGOHint = "disabled"
)
8 changes: 8 additions & 0 deletions common/cgo_enabled.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
//go:build cgo

package common

const (
CGOEnabled = true
CGOHint = "enabled"
)
5 changes: 3 additions & 2 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import (
"syscall"
"time"

"github.com/layou233/ZBProxy/common"
"github.com/layou233/ZBProxy/config"
"github.com/layou233/ZBProxy/console"
"github.com/layou233/ZBProxy/service"
Expand All @@ -30,8 +31,8 @@ func main() {
/ /__ | |_| | | | | | \ \ | |_| | / /\ \ / /
/_____| |_____/ |_| |_| \_\ \_____/ /_/ \_\ /_/`))
color.HiGreen("Welcome to ZBProxy %s (%s)!\n", version.Version, version.CommitHash)
color.HiBlack("Build Information: %s, %s/%s\n",
runtime.Version(), runtime.GOOS, runtime.GOARCH)
color.HiBlack("Build Information: %s, %s/%s, CGO %s\n",
runtime.Version(), runtime.GOOS, runtime.GOARCH, common.CGOHint)
go version.CheckUpdate()

config.LoadConfig()
Expand Down

0 comments on commit b280393

Please sign in to comment.