mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-11-15 14:26:33 +01:00
8fcb45896a
Co-authored-by: Muhammad Falak R Wani <falakreyaz@gmail.com>
37 lines
780 B
Diff
37 lines
780 B
Diff
diff --git a/version/version.go b/version/version.go
|
|
index 9ca8aba..d9bd968 100644
|
|
--- a/version/version.go
|
|
+++ b/version/version.go
|
|
@@ -4,9 +4,6 @@ package version
|
|
|
|
import (
|
|
"fmt"
|
|
- "runtime/debug"
|
|
-
|
|
- "github.com/Masterminds/semver/v3"
|
|
)
|
|
|
|
// Version supplies the semantic version.
|
|
@@ -14,20 +11,8 @@ var Version string
|
|
|
|
// String prints the build information for the bot.
|
|
func String() string {
|
|
- hash := "unknown"
|
|
-
|
|
- _, err := semver.NewVersion(Version)
|
|
- if err != nil {
|
|
- Version = "dev"
|
|
- }
|
|
-
|
|
- if info, ok := debug.ReadBuildInfo(); ok {
|
|
- for _, s := range info.Settings {
|
|
- if s.Key == "vcs.revision" {
|
|
- hash = s.Value
|
|
- }
|
|
- }
|
|
- }
|
|
+ Version = "@version@"
|
|
+ hash := "@vcsHash@"
|
|
|
|
return fmt.Sprintf("Version : %s\nGit Hash: %s\n", Version, hash)
|
|
}
|