Skip to content

refactor: clean up unused code, fix typos, improve docs#7

Open
taigrr wants to merge 1 commit intomasterfrom
cd/code-review-improvements
Open

refactor: clean up unused code, fix typos, improve docs#7
taigrr wants to merge 1 commit intomasterfrom
cd/code-review-improvements

Conversation

@taigrr
Copy link
Owner

@taigrr taigrr commented Feb 18, 2026

Changes

  • Remove unused code: killed const and unitTypes var flagged by staticcheck (U1000)
  • Replace regexp with strings in isFailed: Uses strings.TrimSuffix + switch for consistency with isActive and isEnabled
  • Fix typos: 'programatically' → 'programmatically', 'an an int' → 'as an int'
  • Add godoc comments: Missing doc comments on GetSocketsForServiceUnit, GetUnits, GetMaskedUnits, IsSystemd, IsMasked, IsRunning
  • Bump Go version: 1.18 → 1.21 (1.18 is EOL)

All changes pass go vet, staticcheck, and go build.

- Remove unused 'killed' const and 'unitTypes' var (staticcheck U1000)
- Replace regexp with strings.TrimSuffix+switch in isFailed for consistency
- Fix typo: 'programatically' -> 'programmatically'
- Fix typo: 'an an int' -> 'as an int' in README and helpers.go
- Add missing godoc comments on exported helper functions
- Bump minimum Go version from 1.18 to 1.21
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