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
Open
Fix stale hardcoded version fallback in cmd/panel/main.go (1.4.0 -> 1.4.1)#2ShiyunXu wants to merge 1 commit into
ShiyunXu wants to merge 1 commit into
Conversation
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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
cmd/panel/main.gohardcodesvar version = "1.4.0"as a fallback for when the binary is built without the Makefile's-ldflags "-X main.version=..."injection. This repo'sVERSIONfile (and the valuemake buildinjects) is already1.4.1, so the fallback was stale by one patch release, causingGET /api/versionand the startup log to report1.4.0in any build that bypasses the Makefile (e.g.go run ./cmd/panel, IDE run configs, some Docker builds).Bumped the fallback to
1.4.1to match. Verified withgo build ./....Co-authored-by: Copilot 223556219+Copilot@users.noreply.github.com