ci(lint): forbid endian-unsafe patterns to protect s390x build#933
Merged
Conversation
Enable forbidigo with rules blocking binary.NativeEndian and unsafe.Pointer, both of which are byte-order sensitive and would silently break on the s390x build target (big-endian). The codebase currently has zero usages; this is a guardrail against regressions.
Contributor
|
Claude finished @dangrondahl's task in 3m 0s —— View job PR Review: ci(lint): forbid endian-unsafe patterns
Static AnalysisAll clean — ReviewOverall: This is a clean, well-scoped guardrail. One new file, zero existing violations, clear error messages. LGTM. Config correctness:
Pattern review:
Error messages are clear and actionable — they explain why it's forbidden and what to do instead. This is what good lint messages look like. CI integration is already wired: the lint job in SuggestionsNo blocking issues. One minor thought:
Good work
|
Contributor
Author
|
Breaking it will produce this lint message: cmd/kosli/assertSnapshot.go:64:6: use of `binary.NativeEndian` forbidden because "binary.NativeEndian is not portable; s390x is big-endian. Use binary.BigEndian or binary.LittleEndian explicitly." (forbidigo)
_ = binary.NativeEndian
^
1 issues:
* forbidigo: 1 |
mbevc1
approved these changes
Jun 4, 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.
Summary
.golangci.ymlenablingforbidigowith rules that blockbinary.NativeEndianandunsafe.Pointer.A reviewer who wants to confirm the rule actually fires can drop
_ = binary.NativeEndianinto any.gofile and re-runmake lint.Test plan
make lintpasses locally with the new config (0 issues, 6 linters active including forbidigo)