Revert "Updated the version output to use Go module build information if available. Enabled GoReleaser module proxying for verifiable builds."

This reverts commit 2a3f049336.
This commit is contained in:
Andrey Nering
2021-04-17 17:46:45 -03:00
parent a57beb1de4
commit e79354a039
3 changed files with 4 additions and 28 deletions

View File

@@ -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
}