Skip to content

Commit

Permalink
add go version on lanuch
Browse files Browse the repository at this point in the history
  • Loading branch information
Gaojianli committed Jan 26, 2025
1 parent f296bc1 commit a4b29b5
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 2 deletions.
4 changes: 2 additions & 2 deletions build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ chmod +x output/bootstrap.sh
cp conf/* output/conf/
export GOEXPERIMENT=arenas
if [ "$BUILD_TYPE" != "test" ]; then
go build -ldflags="-w -s" -o output/bin/${RUN_NAME}
go build -ldflags="-w -s -X 'main.Commit=`git log --pretty=format:'%h' -1`'" -o output/bin/${RUN_NAME}
else
go build -gcflags="all=-N -l" -o output/bin/${RUN_NAME}
go build -gcflags="all=-N -l -X 'main.Commit=`git log --pretty=format:'%h' -1`'" -o output/bin/${RUN_NAME}
fi
14 changes: 14 additions & 0 deletions version.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
package main

import (
"log"
"runtime"
)

var (
Commit string
)

func init() {
log.Printf("Runtime: %s\tCommit: %s \n", runtime.Version(), Commit)
}

0 comments on commit a4b29b5

Please sign in to comment.