Conversation
- pkg/fileutil/tar.go: use errors.Is(err, io.EOF) instead of == comparison (errorlint linter requires idiomatic error comparison) - pkg/parser/schema_utilities.go: inline single-use 'ignored' variable to reduce unnecessary intermediate assignment - pkg/cli/audit_report_analysis.go: split long sliceutil.Map call onto multiple lines for improved readability Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
This was referenced Mar 5, 2026
pelikhan
approved these changes
Mar 6, 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.
This PR applies targeted simplifications to recently merged code (last 24 hours) to improve clarity, consistency, and idiomaticity while preserving all functionality.
Files Simplified
pkg/fileutil/tar.go— useerrors.Is(err, io.EOF)instead of direct==comparisonpkg/parser/schema_utilities.go— inline single-useignoredvariablepkg/cli/audit_report_analysis.go— split longsliceutil.Mapcall for readabilityImprovements Made
1. Idiomatic error comparison (
pkg/fileutil/tar.go)Changed
err == io.EOFtoerrors.Is(err, io.EOF). The project haserrorlintenabled in.golangci.ymlwhich flags direct sentinel error comparisons in favour oferrors.Is. This is consistent with Go 1.13+ best practices.2. Inline single-use variable (
pkg/parser/schema_utilities.go)Removed the intermediate
ignoredvariable that was assigned and immediately used in the nextifstatement. The inline form is more direct and removes unnecessary indirection.Before:
After:
3. Split long line (
pkg/cli/audit_report_analysis.go)Broke a single long
sliceutil.Map(...)call (>120 chars) onto multiple lines, improving readability without changing behavior.Changes Based On
Recent PRs from the last 24 hours:
sliceutil.Filter/Mapusage (introduced the long line)ignoredvariable anderr == io.EOF)Testing
go build ./...)go test ./pkg/fileutil/... ./pkg/parser/...)make fmt)Review Focus
Please verify:
errors.Ischange is semantically equivalent (it is —io.EOFis a simple sentinel, not wrapped)ignoredadded no meaning beyond the expression itself)References: §22732114386