Skip to content

feat: update error handling to use %w for wrapping errors in multiple files #39

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 7 commits into from
May 31, 2025

Conversation

cfc4n
Copy link
Member

@cfc4n cfc4n commented May 30, 2025

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., replacing interface{} with any), improving error handling, and refining configurations for linters and formatting tools.

Dependency Updates:

  • .github/workflows/go-test.yml: Upgraded golangci-lint-action from version v6 to v8 for better compatibility and features. Updated linter arguments to specify version: v2.1.

Code Quality Improvements:

  • cli/cmd/config.go, cli/cmd/root.go, client/client.go, pkg/config/config.go: Replaced interface{} with any 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 for golangci-lint, enabling specific linters (errcheck, staticcheck, errorlint) and excluding irrelevant paths like dist/ and docs/. Introduced custom formatter settings for gofmt and goimports.

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:

  • Multiple files (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]

@dosubot dosubot bot added size:L This PR changes 100-499 lines, ignoring generated files. enhancement New feature or request labels May 30, 2025
@cfc4n cfc4n merged commit 4444673 into master May 31, 2025
6 checks passed
@cfc4n cfc4n deleted the golangci-lint-support branch May 31, 2025 09:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request size:L This PR changes 100-499 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant