8000 feat: update error handling to use %w for wrapping errors in multiple files by cfc4n · Pull Request #39 · gojue/moling · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
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]

cfc4n added 3 commits May 30, 2025 22:47
…ple files

Signed-off-by: CFC4N <cfc4n.cs@gmail.com>
…stency

Signed-off-by: CFC4N <cfc4n.cs@gmail.com>
… files

Signed-off-by: CFC4N <cfc4n.cs@gmail.com>
@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 added 4 commits May 31, 2025 16:03
…owser_debugger.go

Signed-off-by: CFC4N <cfc4n.cs@gmail.com>
…or improved clarity

Signed-off-by: CFC4N <cfc4n.cs@gmail.com>
…arity in multiple files

Signed-off-by: CFC4N <cfc4n.cs@gmail.com>
…arity in root.go, server.go, and server_test.go

Signed-off-by: CFC4N <cfc4n.cs@gmail.com>
@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
0