diff --git a/.goreleaser.yml b/.goreleaser.yml index 31bb56b5..8f855aef 100644 --- a/.goreleaser.yml +++ b/.goreleaser.yml @@ -12,6 +12,8 @@ builds: - linux - darwin - windows + ldflags: + - -s -w -X github.com/k1LoW/tbls.version={{.Version}} -X github.com/k1LoW/tbls.commit={{.FullCommit}} -X github.com/k1LoW/tbls.date={{.Date}} -X github.com/k1LoW/tbls/version.Version={{.Version}} archive: name_template: '{{ .ProjectName }}_v{{ .Version }}_{{ .Os }}_{{ .Arch }}{{ if .Arm }}v{{ .Arm }}{{ end }}' format_overrides: diff --git a/main.go b/main.go index e4fbb10d..0642e49e 100644 --- a/main.go +++ b/main.go @@ -21,23 +21,13 @@ package main import ( - "strings" - _ "github.com/go-sql-driver/mysql" _ "github.com/lib/pq" _ "github.com/mattn/go-sqlite3" "github.com/k1LoW/tbls/cmd" - v "github.com/k1LoW/tbls/version" -) - -var ( - version = "dev" - commit = "none" - date = "unknown" ) func main() { - v.Version = strings.TrimLeft(version, "v") cmd.Execute() }