Skip to content

fix(lint): handle Fprintln errors and use reflect.Pointer - #238

Open
iamlasse wants to merge 2 commits into
marcus:mainfrom
iamlasse:lint/fix-errcheck-govet
Open

fix(lint): handle Fprintln errors and use reflect.Pointer#238
iamlasse wants to merge 2 commits into
marcus:mainfrom
iamlasse:lint/fix-errcheck-govet

Conversation

@iamlasse

@iamlasse iamlasse commented Aug 30, 2026

Copy link
Copy Markdown

Summary

Fixes the 4 issues reported by golangci-lint run (v2.12.2, default config):

  • errcheck (2): cmd/nightshift/commands/commit.go:55,58 — the return error of fmt.Fprintln(os.Stdout, normalized) in the commit normalize command was discarded; it is now propagated as the command's error.
  • govet inline-constant (2): cmd/nightshift/commands/config.go:373,411 — replaced the deprecated reflect.Ptr alias with reflect.Pointer (identical value, no behavior change).

Verification

  • golangci-lint run → 0 issues (was 4)
  • go build ./... → pass
  • go test ./... → all packages pass
  • gofmt -l . → clean

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


Automated by nightshift

iamlasse 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: propagate the error return of fmt.Fprintln in the commit
  normalize command instead of discarding it
- govet: replace the deprecated reflect.Ptr alias with reflect.Pointer

Nightshift-Task: lint-fix
Nightshift-Ref: https://github.com/marcus/nightshift
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