mirror of
https://github.com/slackhq/nebula.git
synced 2025-11-08 22:13:57 +01:00
cleanup
This commit is contained in:
parent
9cc869bb1c
commit
8f0892ce4b
21
main.go
21
main.go
@ -29,12 +29,8 @@ func Main(c *config.C, configTest bool, buildVersion string, logger *logrus.Logg
|
||||
}
|
||||
}()
|
||||
|
||||
// Default to the module version for buildVersion
|
||||
if buildVersion == "" {
|
||||
info, ok := debug.ReadBuildInfo()
|
||||
if ok {
|
||||
buildVersion = strings.TrimPrefix(info.Main.Version, "v")
|
||||
}
|
||||
buildVersion = moduleVersion()
|
||||
}
|
||||
|
||||
l := logger
|
||||
@ -308,3 +304,18 @@ func Main(c *config.C, configTest bool, buildVersion string, logger *logrus.Logg
|
||||
lightHouse.StartUpdateWorker,
|
||||
}, nil
|
||||
}
|
||||
|
||||
func moduleVersion() string {
|
||||
info, ok := debug.ReadBuildInfo()
|
||||
if !ok {
|
||||
return ""
|
||||
}
|
||||
|
||||
for _, dep := range info.Deps {
|
||||
if dep.Path == "github.com/slackhq/nebula" {
|
||||
return strings.TrimPrefix(dep.Version, "v")
|
||||
}
|
||||
}
|
||||
|
||||
return ""
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user