Skip to content
This repository has been archived by the owner on Nov 14, 2023. It is now read-only.

Commit

Permalink
Make make.go compatible with go 1.10 (#59)
Browse files Browse the repository at this point in the history
  • Loading branch information
arbll committed Aug 21, 2018
1 parent 513f018 commit b94583b
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions make.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,7 @@ func main() {
branch := commandOutput("git", "rev-parse", "--abbrev-ref", "HEAD")
go_version := commandOutput(gobin, "version")

// NB: Starting from Go 1.5, the syntax of these ldflags changes from `-X main.var 'value'` to `-X 'main.var=value'`
// For reference see https://github.com/golang/go/issues/12338
ldflags := fmt.Sprintf("-X main.buildDate '%s' -X main.gitCommit '%s' -X main.gitBranch '%s' -X main.goVersion '%s'", date, commit, branch, go_version)
ldflags := fmt.Sprintf("\"-X main.buildDate='%s' -X=main.gitCommit='%s' -X main.gitBranch='%s' -X main.goVersion='%s'\"", date, commit, branch, go_version)

cmd := exec.Command(gobin, []string{"build", "-a", "-ldflags", ldflags}...)
cmd.Stdout = os.Stdout
Expand Down

0 comments on commit b94583b

Please sign in to comment.