fix: pass version correctly

resolves #176
This commit is contained in:
Jan De Dobbeleer 2020-11-20 13:01:01 +01:00 committed by Jan De Dobbeleer
parent 4bcd98cda7
commit a73641d2d7
2 changed files with 3 additions and 3 deletions

View file

@ -68,7 +68,7 @@ jobs:
uses: actions/checkout@v2 uses: actions/checkout@v2
- name: Build - name: Build
id: build id: build
run: go build -o ${{ matrix.ARTIFACT }} -ldflags="-X 'main.version= ${{ needs.release.outputs.version }}'" run: go build -o ${{ matrix.ARTIFACT }} -ldflags="-X 'main.Version=${{ needs.release.outputs.version }}'"
env: env:
GOARCH: "amd64" GOARCH: "amd64"
- name: Hash - name: Hash

View file

@ -7,7 +7,7 @@ import (
"fmt" "fmt"
) )
var currentVersion = "development" var Version = "development"
type args struct { type args struct {
ErrorCode *int ErrorCode *int
@ -70,7 +70,7 @@ func main() {
return return
} }
if *args.Version { if *args.Version {
fmt.Println(currentVersion) fmt.Println(Version)
return return
} }
colorWriter := &Renderer{ colorWriter := &Renderer{