Skip to content

refactor: reduce run function complexity#16

Merged
mlorentedev merged 1 commit intomasterfrom
fix/lint-and-complexity
Mar 8, 2026
Merged

refactor: reduce run function complexity#16
mlorentedev merged 1 commit intomasterfrom
fix/lint-and-complexity

Conversation

@mlorentedev
Copy link
Owner

Summary

This PR further refactors main.go to reduce the cyclomatic complexity of the run function.

Changes

  • Extracted initTailscale, handleShutdown, and drainActiveConnections from the run function.
  • Reduced cyclomatic complexity of the run function from 19 to 7.
  • Cleaned up redundant logging.

This ensures the codebase remains maintainable and adheres to the linter's complexity limits (Gocyclo < 15).

## Summary

- Extract initTailscale, handleShutdown, and drainActiveConnections from the run function
- Reduce cyclomatic complexity of run function from 19 to 7
- Improve readability and maintainability of the main entry point
@mlorentedev mlorentedev merged commit dda4461 into master Mar 8, 2026
11 checks passed
@mlorentedev mlorentedev deleted the fix/lint-and-complexity branch March 8, 2026 04: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.

1 participant