1
0
mirror of https://github.com/go-task/task.git synced 2025-06-08 23:56:21 +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 # 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 ## v3.3.0 - 2021-03-20
- Add support for delegating CLI arguments to commands with `--` and a - Add support for delegating CLI arguments to commands with `--` and a

View File

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