fix: remove Buildarch from globals, main, Makefile, logger, and tests
All checks were successful
check / check (push) Successful in 4s

Buildarch was erroneously included. Remove it from:
- internal/globals/globals.go (struct field, package var, setter)
- cmd/dnswatcher/main.go (var declaration, setter call)
- Makefile (BUILDARCH var, ldflags)
- internal/logger/logger.go (Identify log field)
- internal/config/config_test.go (test fixture)
- README.md (build command, architecture section)
This commit is contained in:
clawbot
2026-03-04 03:48:45 -08:00
parent c15ca77bd7
commit c96ed42c31
6 changed files with 15 additions and 32 deletions

View File

@@ -19,9 +19,8 @@ func newTestParams(t *testing.T) config.Params {
t.Helper()
g := &globals.Globals{
Appname: "dnswatcher",
Version: "test",
Buildarch: "amd64",
Appname: "dnswatcher",
Version: "test",
}
l, err := logger.New(nil, logger.Params{Globals: g})

View File

@@ -12,17 +12,15 @@ import (
//
//nolint:gochecknoglobals // Required for ldflags injection at build time
var (
mu sync.RWMutex
appname string
version string
buildarch string
mu sync.RWMutex
appname string
version string
)
// Globals holds build-time variables for dependency injection.
type Globals struct {
Appname string
Version string
Buildarch string
Appname string
Version string
}
// New creates a new Globals instance from package-level variables.
@@ -31,9 +29,8 @@ func New(_ fx.Lifecycle) (*Globals, error) {
defer mu.RUnlock()
return &Globals{
Appname: appname,
Version: version,
Buildarch: buildarch,
Appname: appname,
Version: version,
}, nil
}
@@ -52,11 +49,3 @@ func SetVersion(ver string) {
version = ver
}
// SetBuildarch sets the build architecture.
func SetBuildarch(arch string) {
mu.Lock()
defer mu.Unlock()
buildarch = arch
}

View File

@@ -78,6 +78,5 @@ func (l *Logger) Identify() {
l.log.Info("starting",
"appname", l.params.Globals.Appname,
"version", l.params.Globals.Version,
"buildarch", l.params.Globals.Buildarch,
)
}