Files
pixa/internal/globals/globals.go
user cf825a7260
All checks were successful
check / check (push) Successful in 1m47s
consolidate appname to internal/globals as a constant
The appname was redundantly defined in both cmd/pixad/main.go and
internal/globals/globals.go. Since it is always "pixad" and is not
actually set via ldflags (only Version is), define it once as an
unexported constant in globals.go and remove it from main.go.
2026-03-17 01:53:21 -07:00

26 lines
538 B
Go

// Package globals provides application-wide constants set at build time.
package globals
import (
"go.uber.org/fx"
)
const appname = "pixad"
// Version is populated from main() via ldflags.
var Version string //nolint:gochecknoglobals // set from main
// Globals holds application-wide constants.
type Globals struct {
Appname string
Version string
}
// New creates a new Globals instance from build-time variables.
func New(_ fx.Lifecycle) (*Globals, error) {
return &Globals{
Appname: appname,
Version: Version,
}, nil
}