1 KiB
1 KiB
Code Review: CLI Entrypoints
Scope
cmd/musiclink/main.gocmd/smoketest/main.go
Findings
✅ Strengths
- Clean startup flow: load config → init handler → choose Matrix vs Matterbridge → run with signal cancellation.
- Matrix mode cleanly isolated;
mxBot.Close()called after run. - Smoke test exercises detector/API/resolver end-to-end with clear output.
⚠️ Issues / Opportunities
-
Matterbridge close on fatal path
- If
mbBot.Runreturns a non-canceled error,log.Fatalfexits beforembBot.Close()runs. - Low impact (process exits), but consistent cleanup could be improved by deferring close after construction.
- If
-
Smoke test hard-fails on external API issues
- Smoke test exits on any API error (expected), but no retries/backoff.
- Acceptable for manual runs; document that it depends on idonthavespotify uptime.
Notes
- Signal handling and shutdown behavior are consistent with a long-running service.
- No CLI flags for selecting mode beyond config; that matches config-first expectations.