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
- name: 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:
GOARCH: "amd64"
- name: Hash

View file

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