diff --git a/.goreleaser.yml b/.goreleaser.yml index 07f3e719..e67d7b9f 100644 --- a/.goreleaser.yml +++ b/.goreleaser.yml @@ -17,11 +17,6 @@ build: goarch: 386 env: - CGO_ENABLED=0 - ldflags: - - -s -w # Don't set main.version. - -gomod: - proxy: true archives: - name_template: "{{.Binary}}_{{.Os}}_{{.Arch}}" diff --git a/CHANGELOG.md b/CHANGELOG.md index 65591a89..2f6a7a6e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -11,8 +11,6 @@ ([#135](https://github.com/go-task/task/issues/135)). - Print task name before the command in the log output ([#398](https://github.com/go-task/task/pull/398)). -- Improve version reporting when building Task from source using Go Modules - ([#462](https://github.com/go-task/task/pull/462)). ## v3.3.0 - 2021-03-20 diff --git a/cmd/task/task.go b/cmd/task/task.go index 000d0137..11d7ffab 100644 --- a/cmd/task/task.go +++ b/cmd/task/task.go @@ -7,7 +7,6 @@ import ( "os" "os/signal" "path/filepath" - "runtime/debug" "strings" "syscall" @@ -19,7 +18,9 @@ import ( "github.com/go-task/task/v3/taskfile" ) -var version = "" +var ( + version = "master" +) const usage = `Usage: task [-ilfwvsd] [--init] [--list] [--force] [--watch] [--verbose] [--silent] [--dir] [--taskfile] [--dry] [--summary] [task...] @@ -92,7 +93,7 @@ func main() { pflag.Parse() if versionFlag { - fmt.Printf("Task version: %s\n", getVersion()) + fmt.Printf("Task version: %s\n", version) return } @@ -216,21 +217,3 @@ func getSignalContext() context.Context { }() return ctx } - -func getVersion() string { - if version != "" { - return version - } - - info, ok := debug.ReadBuildInfo() - if !ok || info.Main.Version == "" { - return "unknown" - } - - version = info.Main.Version - if info.Main.Sum != "" { - version += fmt.Sprintf(" (%s)", info.Main.Sum) - } - - return version -}