Fix non-constant format string vet errors for Go 1.26 toolchain#446
Open
mchen727 wants to merge 1 commit into
Open
Fix non-constant format string vet errors for Go 1.26 toolchain#446mchen727 wants to merge 1 commit into
mchen727 wants to merge 1 commit into
Conversation
The moc-service-release build now uses the latest MS Go toolchain (go-aka 1.26.5-2), whose `go test` printf vet analyzer rejects non-constant format strings as errors. The releases/v0.26.0 branch (Go 1.22-era code) failed to build under this toolchain while main already carries the equivalent fixes. Add a constant "%s" format verb to the flagged Wrapf/Errorf/Fatalf call sites in pkg/validations, pkg/status, pkg/config, pkg/certs, and pkg/redact so `go test ./pkg/...` passes under Go 1.26. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: a5fc3af6-9324-437e-9933-0bf3cc26b490
|
Azure Pipelines: There may be pipelines that require an authorized user to comment /azp run to run. |
raghavendra-nataraj
approved these changes
Jul 24, 2026
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.
Backports main's Go 1.26 compatibility fix to releases/v0.26.0.
The moc-service-release build now uses the latest MS Go toolchain (go-aka 1.26.5-2), whose
go testprintf analyzer rejects non-constant format strings as errors. This branch's Go 1.22-era code failedmake unittestwhile main already carries the equivalent fixes.Adds a constant
"%s"verb to the flagged Wrapf/Errorf/Fatalf calls in pkg/validations, pkg/status, pkg/config, pkg/certs, pkg/redact.Validated:
go test -vet=printf -run '^$' ./pkg/...reports 0 non-constant format string issues.