Skip to content

Fix stale hardcoded version fallback in cmd/panel/main.go (1.4.0 -> 1.4.1) - #2

Open
ShiyunXu wants to merge 1 commit into
iPmartNetwork:masterfrom
ShiyunXu:fix/upstream-version-fallback
Open

Fix stale hardcoded version fallback in cmd/panel/main.go (1.4.0 -> 1.4.1)#2
ShiyunXu wants to merge 1 commit into
iPmartNetwork:masterfrom
ShiyunXu:fix/upstream-version-fallback

Conversation

@ShiyunXu

Copy link
Copy Markdown

cmd/panel/main.go hardcodes var version = "1.4.0" as a fallback for when the binary is built without the Makefile's -ldflags "-X main.version=..." injection. This repo's VERSION file (and the value make build injects) is already 1.4.1, so the fallback was stale by one patch release, causing GET /api/version and the startup log to report 1.4.0 in any build that bypasses the Makefile (e.g. go run ./cmd/panel, IDE run configs, some Docker builds).

Bumped the fallback to 1.4.1 to match. Verified with go build ./....

Co-authored-by: Copilot 223556219+Copilot@users.noreply.github.com

cmd/panel/main.go's `version` variable is a fallback used whenever the
binary is built without the Makefile's -ldflags "-X main.version=..."
injection (e.g. `go run ./cmd/panel` or `go build` invoked directly).
It was still hardcoded to the previous release, 1.4.0, while the
repo's VERSION file (and the value Make injects at build time) is
1.4.1. This caused GET /api/version and the panel's own startup log to
report the wrong build version whenever the binary was built without
the Makefile.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants