feat: update error handling to use %w for wrapping errors in multiple files #39
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 pull request introduces several changes to improve code quality, enhance maintainability, and update dependencies across multiple files. Key updates include upgrading the
golangci-lint
action version, adopting modern Go conventions (e.g., replacinginterface{}
withany
), improving error handling, and refining configurations for linters and formatting tools.Dependency Updates:
.github/workflows/go-test.yml
: Upgradedgolangci-lint-action
from versionv6
tov8
for better compatibility and features. Updated linter arguments to specifyversion: v2.1
.Code Quality Improvements:
cli/cmd/config.go
,cli/cmd/root.go
,client/client.go
,pkg/config/config.go
: Replacedinterface{}
withany
across multiple files to align with modern Go conventions. Improved error messages by using%w
for wrapping errors instead of%v
. [1] [2] [3] [4] [5]Configuration Enhancements:
.golangci.yml
: Added a detailed configuration file forgolangci-lint
, enabling specific linters (errcheck
,staticcheck
,errorlint
) and excluding irrelevant paths likedist/
anddocs/
. Introduced custom formatter settings forgofmt
andgoimports
.Bug Fixes:
pkg/server/server.go
: Fixed incorrect variable usage (%m
instead of%s
) in logging statements for the SSE server. Ensured proper handling of server configurations and logging.Code Organization:
cli/cmd/client.go
,cli/cmd/config.go
,cli/cmd/root.go
, etc.): Reorganized import statements for better readability and consistency by grouping standard library, third-party, and project-specific imports. [1] [2] [3]