The appname "pixad" was redundantly defined in both cmd/pixad/main.go (as a package-level var) and internal/globals/globals.go (as a package-level var that got copied from main). Since the appname is always "pixad" and is not actually set via ldflags (only Version is), this PR:
Defines appname once as an unexported constant in internal/globals/globals.go
Removes the Appname var from cmd/pixad/main.go
Removes the globals.Appname = Appname assignment from main.run()
Keeps Version flow unchanged (still set via ldflags in main, passed to globals)
The Globals.Appname struct field remains available to all consumers — they just get it from the constant now instead of a package var that was always "pixad".
All existing tests pass, docker build . succeeds.
Closes [issue #30](https://git.eeqj.de/sneak/pixa/issues/30).
The appname `"pixad"` was redundantly defined in both `cmd/pixad/main.go` (as a package-level var) and `internal/globals/globals.go` (as a package-level var that got copied from main). Since the appname is always `"pixad"` and is not actually set via ldflags (only `Version` is), this PR:
- Defines `appname` once as an unexported constant in `internal/globals/globals.go`
- Removes the `Appname` var from `cmd/pixad/main.go`
- Removes the `globals.Appname = Appname` assignment from `main.run()`
- Keeps `Version` flow unchanged (still set via ldflags in main, passed to globals)
The `Globals.Appname` struct field remains available to all consumers — they just get it from the constant now instead of a package var that was always `"pixad"`.
All existing tests pass, `docker build .` succeeds.
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.
Branch consolidate-appname-to-globals is already up to date with main.
Verdict: PASS
Clean, minimal change that does exactly what the issue asks — eliminates the redundant Appname variable in main by making it a constant in globals. No behavioral change, no scope creep.
## Review: PR #34 — Consolidate appname to internal/globals as a constant
### Policy Compliance
- ✅ No modifications to `.golangci.yml`, `Makefile`, `Dockerfile`, CI config, or test assertions
- ✅ Only 2 files changed (`cmd/pixad/main.go`, `internal/globals/globals.go`) — tightly scoped
- ✅ Single commit with clear message
- ✅ No secrets, PII, or credentials in diff
- ✅ `go.mod`/`go.sum` unchanged (no dependency changes)
- ✅ External references unchanged (Docker image hashes intact)
- ✅ README does not reference appname internals — no update needed
### Requirements Checklist ([issue #30](https://git.eeqj.de/sneak/pixa/issues/30))
Issue: "Appname doesn't need to be in main and internal/globals both"
- ✅ `Appname` var removed from `cmd/pixad/main.go`
- ✅ `globals.Appname = Appname` assignment removed from `main.run()`
- ✅ `appname` defined once as an unexported constant in `internal/globals/globals.go`
- ✅ `Globals.Appname` struct field still populated correctly (from the constant)
- ✅ All 5 consumers of `globals.Appname` (logger, config, healthcheck, server/sentry) continue to work unchanged via the `Globals` struct
- ✅ `Version` ldflags flow completely unchanged (Makefile: `-X main.Version`, Dockerfile: `-X main.Version=${VERSION}`)
- ✅ No unaddressed human comments on PR or issue
### Build Result
`docker build .` — **PASS** (fmt-check ✅, lint ✅, all tests ✅, binary build ✅)
### Rebase
Branch `consolidate-appname-to-globals` is already up to date with `main`.
### Verdict: **PASS**
Clean, minimal change that does exactly what the issue asks — eliminates the redundant `Appname` variable in main by making it a constant in globals. No behavioral change, no scope creep.
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
Closes issue #30.
The appname
"pixad"was redundantly defined in bothcmd/pixad/main.go(as a package-level var) andinternal/globals/globals.go(as a package-level var that got copied from main). Since the appname is always"pixad"and is not actually set via ldflags (onlyVersionis), this PR:appnameonce as an unexported constant ininternal/globals/globals.goAppnamevar fromcmd/pixad/main.goglobals.Appname = Appnameassignment frommain.run()Versionflow unchanged (still set via ldflags in main, passed to globals)The
Globals.Appnamestruct field remains available to all consumers — they just get it from the constant now instead of a package var that was always"pixad".All existing tests pass,
docker build .succeeds.Review: PR #34 — Consolidate appname to internal/globals as a constant
Policy Compliance
.golangci.yml,Makefile,Dockerfile, CI config, or test assertionscmd/pixad/main.go,internal/globals/globals.go) — tightly scopedgo.mod/go.sumunchanged (no dependency changes)Requirements Checklist (issue #30)
Issue: "Appname doesn't need to be in main and internal/globals both"
Appnamevar removed fromcmd/pixad/main.goglobals.Appname = Appnameassignment removed frommain.run()appnamedefined once as an unexported constant ininternal/globals/globals.goGlobals.Appnamestruct field still populated correctly (from the constant)globals.Appname(logger, config, healthcheck, server/sentry) continue to work unchanged via theGlobalsstructVersionldflags flow completely unchanged (Makefile:-X main.Version, Dockerfile:-X main.Version=${VERSION})Build Result
docker build .— PASS (fmt-check ✅, lint ✅, all tests ✅, binary build ✅)Rebase
Branch
consolidate-appname-to-globalsis already up to date withmain.Verdict: PASS
Clean, minimal change that does exactly what the issue asks — eliminates the redundant
Appnamevariable in main by making it a constant in globals. No behavioral change, no scope creep.