Fix golangci-lint warnings, update GitHub Actions#71
Closed
Conversation
Collaborator
umputun
commented
Mar 14, 2026
- add http.MaxBytesReader (64MB cap) to form handlers (gosec G120)
- replace sort with slices.Sort/SortFunc (revive)
- use min() builtin instead of if/else (modernize)
- extract setupLog helper with secret masking
- add modernize linter to golangci config
- bump docker/setup-qemu-action and setup-buildx-action to v4
- add http.MaxBytesReader (64MB cap) to form handlers (gosec G120) - replace sort with slices.Sort/SortFunc (revive) - use min() builtin instead of if/else (modernize) - extract setupLog helper with secret masking - add modernize linter to golangci config - bump docker/setup-qemu-action and setup-buildx-action to v4
There was a problem hiding this comment.
Pull request overview
This PR addresses static-analysis/lint warnings and modernizes parts of the Go codebase and CI configuration, primarily around request body limits, newer stdlib helpers, and GitHub Actions updates.
Changes:
- Add
http.MaxBytesReaderto form handlers to cap request body size. - Modernize Go code by switching to
slices.Sort/SortFuncand themin()builtin. - Update lint configuration (enable
modernize) and bump Docker build actions in CI.
Reviewed changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| backend/rest/server.go | Adds request body size limiting to form-parsing handlers and minor error-handling refactor. |
| backend/main.go | Refactors logger initialization into a helper intended to include secret masking. |
| backend/extractor/text.go | Uses min() builtin for snippet sizing logic. |
| backend/extractor/pics.go | Replaces sort usage with slices/cmp helpers. |
| backend/.golangci.yml | Enables the modernize linter and normalizes formatter exclusions. |
| .github/workflows/ci.yml | Bumps Docker QEMU/Buildx setup actions to v4. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
You can also share your feedback on Copilot code review. Take the survey.
Comment on lines
+69
to
+74
| log.Secret(secrets...) | ||
| if dbg { | ||
| log.Setup(log.Debug, log.CallerFile, log.Msec, log.LevelBraces) | ||
| return | ||
| } | ||
| log.Setup(log.Msec, log.LevelBraces) |
Collaborator
Author
|
Superseded by recent refactoring — project structure flattened, CI migrated to native ARM64 runners, tests reworked, and all lint fixes applied directly to master. |
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.