1
0
mirror of https://github.com/go-task/task.git synced 2024-12-04 10:24:45 +02:00

Use early return and add CHANGELOG for #462

This commit is contained in:
Andrey Nering 2021-04-04 15:32:39 -03:00
parent 2a3f049336
commit ec8b1403bd
2 changed files with 12 additions and 7 deletions

View File

@ -1,5 +1,10 @@
# Changelog
## Unreleased
- 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
- Add support for delegating CLI arguments to commands with `--` and a

View File

@ -222,14 +222,14 @@ func getVersion() string {
return version
}
if info, ok := debug.ReadBuildInfo(); ok && info.Main.Version != "" {
version = info.Main.Version
info, ok := debug.ReadBuildInfo()
if !ok || info.Main.Version == "" {
return "unknown"
}
if info.Main.Sum != "" {
version += fmt.Sprintf(" (%s)", info.Main.Sum)
}
} else {
version = "unknown"
version = info.Main.Version
if info.Main.Sum != "" {
version += fmt.Sprintf(" (%s)", info.Main.Sum)
}
return version