mirror of
https://github.com/slackhq/nebula.git
synced 2025-11-09 03:33:58 +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 == "" {
|
if buildVersion == "" {
|
||||||
info, ok := debug.ReadBuildInfo()
|
buildVersion = moduleVersion()
|
||||||
if ok {
|
|
||||||
buildVersion = strings.TrimPrefix(info.Main.Version, "v")
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
l := logger
|
l := logger
|
||||||
@ -308,3 +304,18 @@ func Main(c *config.C, configTest bool, buildVersion string, logger *logrus.Logg
|
|||||||
lightHouse.StartUpdateWorker,
|
lightHouse.StartUpdateWorker,
|
||||||
}, nil
|
}, 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