Skip to content

fix(lint): handle stdout write errors and use reflect.Pointer - #221

Open
iamlasse wants to merge 2 commits into
marcus:mainfrom
iamlasse:lint/fix-golangci-issues
Open

fix(lint): handle stdout write errors and use reflect.Pointer#221
iamlasse wants to merge 2 commits into
marcus:mainfrom
iamlasse:lint/fix-golangci-issues

Conversation

@iamlasse

@iamlasse iamlasse commented Aug 19, 2026

Copy link
Copy Markdown

Summary

Fixes the 4 remaining golangci-lint findings so the repo lints clean with default settings:

  • errcheck (2): cmd/nightshift/commands/commit.go — the commit normalize command called fmt.Fprintln(os.Stdout, normalized) without checking the write error in both the --check branch and the normal path. Both now return the error.
  • govet (2): cmd/nightshift/commands/config.go — replaced the deprecated reflect.Ptr constant with its Go 1.18+ synonym reflect.Pointer in printStruct and isZero. No behavior change.

Verification

  • gofmt -l . — clean
  • go vet ./... — clean
  • golangci-lint run --timeout 5m — 0 issues
  • go build ./... — ok
  • go test ./... — all packages pass

🤖 Generated with Claude Code


Automated by nightshift

iamlasse and others added 2 commits June 28, 2026 02:10
Add internal/commits with pure Normalize/validate functions enforcing the project's Conventional Commits rules (known type set, lowercase type, lowercase subject, 72-char subject limit, whitespace trimming, and 72-column body wrapping). Wire it into the CLI as 'nightshift commit normalize' (positional, --file, and stdin sources; --check to validate only), ship a commit-msg git hook under scripts/, and document the format and installation in docs/commit-messages.md.

Nightshift-Task: commit-normalize
Nightshift-Ref: https://github.com/marcus/nightshift
- errcheck: check the error return of fmt.Fprintln(os.Stdout, ...) in
both branches of commit normalize - govet: replace deprecated
reflect.Ptr with the reflect.Pointer synonym in config.go (no behavior
change)

Nightshift-Task: lint-fix
Nightshift-Ref: https://github.com/marcus/nightshift

Co-Authored-By: Claude <noreply@anthropic.com>
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