Skip to content

fix: gosec issue in epoch-naming - #1589

Merged
alexandear merged 1 commit into
mgechev:masterfrom
alexandear:fix/epoch-naming-pkg-typecheck
Nov 28, 2025
Merged

fix: gosec issue in epoch-naming#1589
alexandear merged 1 commit into
mgechev:masterfrom
alexandear:fix/epoch-naming-pkg-typecheck

Conversation

@alexandear

Copy link
Copy Markdown
Collaborator

This won't cause any issues because epoch-naming has not been released yet.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR addresses a gosec (Go security linter) issue in the epoch-naming rule by adding proper error handling for the TypeCheck() method call. The fix ensures that type-checking errors are properly captured and reported, following the established error handling pattern used in other rule implementations.

Key Changes

  • Added error checking for file.Pkg.TypeCheck() with proper error reporting via lint.NewInternalFailure
  • Cleaned up test data by removing an invalid blank identifier short declaration and adding proper unused variable handling
  • Removed the gosec exclusion for epoch_naming.go from linting configuration

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.

File Description
rule/epoch_naming.go Added error handling for TypeCheck() call, returning internal failure with formatted error message
testdata/epoch_naming.go Removed invalid short declaration syntax with blank identifier; added _ = c to prevent unused variable warning
.golangci.yml Removed gosec exclusion for epoch_naming.go now that the security issue is fixed

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@alexandear
alexandear merged commit bec3e61 into mgechev:master Nov 28, 2025
16 checks passed
@alexandear
alexandear deleted the fix/epoch-naming-pkg-typecheck branch November 28, 2025 07:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

3 participants