Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@natsirtguy
Copy link
Contributor

This PR fixes all pre-existing golangci-lint issues that were causing CI failures.

Changes

  • gocyclo: Extract parseCallArgs() helper function in call.go to reduce cyclomatic complexity
  • gocritic: Convert if-else chain to switch statement in new.go
  • goconst: Add exported transport constants (TransportSSE, TransportHTTP, TransportStdio) to root.go and use them throughout
  • goconst: Use existing entity type constants in web.go instead of string literals
  • gofmt: Fix formatting in root.go, utils.go, transport_test.go
  • revive (empty-block): Fix by inverting condition in utils.go
  • revive (var-naming): Add nolint directive for GetSessionId - method name is required by transport.Interface from mcp-go

Notes

The GetSessionId naming issue cannot be fixed without changes to the upstream mcp-go library, as it defines the interface method with that name. Added a nolint directive with explanation.

Testing

  • All existing tests pass
  • Verified functionality with real MCP server (filesystem server)
  • golangci-lint run now reports 0 issues

- Extract parseCallArgs() to reduce cyclomatic complexity in call.go
- Convert if-else chain to switch in new.go
- Add exported transport constants (TransportSSE, TransportHTTP, TransportStdio)
- Use entity type constants instead of string literals in web.go
- Use transport constants instead of string literals in utils.go
- Fix gofmt formatting issues in root.go, utils.go, transport_test.go
- Fix empty-block by inverting condition in utils.go
- Add nolint directive for GetSessionId (required by mcp-go interface)
@f f merged commit e7bd724 into f:master Dec 18, 2025
2 checks passed
@natsirtguy natsirtguy deleted the fix/golangci-lint branch December 19, 2025 18:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants