Skip to content

Commit

Permalink
Manually set the version into the apps
Browse files Browse the repository at this point in the history
It appears that Go's method of feeding in the actual version highly
depends on whether you build via make or via some other pipeline.

Hardcoding the application's version number in 1 place seems a reasonable
approach
  • Loading branch information
job committed Aug 6, 2024
1 parent bf5793c commit d274ee4
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 9 deletions.
4 changes: 1 addition & 3 deletions cmd/rtrdump/rtrdump.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,7 @@ const (
)

var (
version = ""
buildinfos = ""
AppVersion = "RTRdump " + version + " " + buildinfos
AppVersion = "RTRdump " + rtr.APP_VERSION

Connect = flag.String("connect", "127.0.0.1:8282", "Connection address")
OutFile = flag.String("file", "output.json", "Output file")
Expand Down
4 changes: 1 addition & 3 deletions cmd/rtrmon/rtrmon.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,9 +42,7 @@ const (
type thresholds []int64

var (
version = ""
buildinfos = ""
AppVersion = "RTRmon " + version + " " + buildinfos
AppVersion = "RTRmon " + rtr.APP_VERSION
//go:embed index.html.tmpl
IndexTemplate string

Expand Down
4 changes: 1 addition & 3 deletions cmd/stayrtr/stayrtr.go
Original file line number Diff line number Diff line change
Expand Up @@ -44,9 +44,7 @@ const (
)

var (
version = ""
buildinfos = ""
AppVersion = "StayRTR " + version + " " + buildinfos
AppVersion = "StayRTR " + rtr.APP_VERSION

MetricsAddr = flag.String("metrics.addr", ":9847", "Metrics address")
MetricsPath = flag.String("metrics.path", "/metrics", "Metrics path")
Expand Down
2 changes: 2 additions & 0 deletions lib/structs.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ type Logger interface {
}

const (
APP_VERSION = "0.6.0"

// We use the size of the largest sensible PDU.
//
// We ignore the theoretically unbounded length of SKIs for router keys.
Expand Down

0 comments on commit d274ee4

Please sign in to comment.