Browse Source

update version

pull/141/head v1.8.1
yedf2 5 years ago
parent
commit
6f8af2b7e1
  1. 3
      .gitignore
  2. 2
      helper/.goreleaser.yml
  3. 9
      main.go

3
.gitignore

@ -14,4 +14,5 @@ coverage.*
profile.* profile.*
test.sh test.sh
dtm dtm
dtm.* dtm-*
dtm.*

2
helper/.goreleaser.yml

@ -12,4 +12,4 @@ builds:
dir: . dir: .
main: main.go main: main.go
ldflags: ldflags:
- -s -w -X main.Version={{.Version}} -X main.Commit={{.Commit}} -X main.Date={{.Date}} - -s -w -X main.Version={{.Version}}

9
main.go

@ -25,18 +25,13 @@ import (
_ "github.com/dtm-labs/dtmdriver-protocol1" _ "github.com/dtm-labs/dtmdriver-protocol1"
) )
var Version, Commit, Date string var Version string
func version() { func version() {
if Version == "" { if Version == "" {
Version = "0.0.0-dev" Version = "0.0.0-dev"
Commit = "NA"
Date = "NA"
} }
if len(Commit) > 8 { fmt.Printf("dtm version: %s\n", Version)
Commit = Commit[:8]
}
fmt.Printf("version: %s commit: %s built at: %s\n", Version, Commit, Date)
} }
func usage() { func usage() {

Loading…
Cancel
Save