Remove Buildarch from ldflags, use runtime.GOARCH instead
The architecture is available at runtime via stdlib, no need to bake it in at build time.
This commit is contained in:
@@ -7,25 +7,20 @@ import (
|
||||
|
||||
// Build-time variables populated from main() via ldflags.
|
||||
var (
|
||||
Appname string //nolint:gochecknoglobals // set from main
|
||||
Version string //nolint:gochecknoglobals // set from main
|
||||
Buildarch string //nolint:gochecknoglobals // set from main
|
||||
Appname string //nolint:gochecknoglobals // set from main
|
||||
Version string //nolint:gochecknoglobals // set from main
|
||||
)
|
||||
|
||||
// Globals holds application-wide constants.
|
||||
type Globals struct {
|
||||
Appname string
|
||||
Version string
|
||||
Buildarch string
|
||||
Appname string
|
||||
Version string
|
||||
}
|
||||
|
||||
// New creates a new Globals instance from build-time variables.
|
||||
func New(_ fx.Lifecycle) (*Globals, error) {
|
||||
n := &Globals{
|
||||
Appname: Appname,
|
||||
Buildarch: Buildarch,
|
||||
Version: Version,
|
||||
}
|
||||
|
||||
return n, nil
|
||||
return &Globals{
|
||||
Appname: Appname,
|
||||
Version: Version,
|
||||
}, nil
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user