|
@@ -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 ""
|
|
|
+}
|