Skip to content

Commit aabcbc9

Browse files
authored
refactor: split connection.go into focused, maintainable files (#291)
Fixes #273 Split the massive 3,587-line connection.go into 7 focused, maintainable files: - connection.go (275 lines) - Main Connect() dispatcher, core types - connection_browser.go (95 lines) - Browser launching, GUI detection - connection_docker.go (145 lines) - Docker isolation setup and helpers - connection_stdio.go (451 lines) - Stdio transport and command building - connection_http.go (314 lines) - HTTP/SSE transports and auth strategies - connection_oauth.go (2,189 lines) - All OAuth flows and error handling - connection_lifecycle.go (243 lines) - Initialization and disconnect logic Key achievements: - 92% reduction in main file size (3,587 → 275 lines) - 100% test pass rate - All tests pass - No race conditions - go test -race passes - No linter errors - Clean code quality - No breaking changes - All public APIs preserved - No circular dependencies - Clean dependency flow Testing verified: - All unit tests pass (100+ tests) - Race detection clean - Linter passes - OAuth tests pass - No circular dependencies
1 parent 631e93c commit aabcbc9

7 files changed

Lines changed: 3465 additions & 3340 deletions

File tree

0 commit comments

Comments
 (0)