Skip to content

Commit

Permalink
Merge pull request #37 from kmdkuk/add-debug-message
Browse files Browse the repository at this point in the history
Add debug log
  • Loading branch information
kmdkuk authored Jul 9, 2022
2 parents bff4fd3 + 4027242 commit 67f6ff6
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions pkg/version/version.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
package version

import (
"fmt"
"runtime/debug"

"go.uber.org/zap"
)

var (
Expand All @@ -23,6 +26,7 @@ func GetVersion() string {

// if go install
if buildInfo, ok := debug.ReadBuildInfo(); ok && buildInfo.Main.Version != "" {
zap.L().Debug(fmt.Sprintf("get buildInfo.Main %v", buildInfo.Main))
return buildInfo.Main.Version
}

Expand Down Expand Up @@ -60,6 +64,7 @@ func getBuildSettings(key string) (string, bool) {
if !ok {
return "", false
}
zap.L().Debug(fmt.Sprintf("get buildInfo.Settings %v", buildInfo.Settings))
for _, v := range buildInfo.Settings {
if v.Key == key {
return v.Value, true
Expand Down

0 comments on commit 67f6ff6

Please sign in to comment.