Skip to content

chore: fix golangci-lint findings - #230

Open
iamlasse wants to merge 2 commits into
marcus:mainfrom
iamlasse:chore/lint-fix-20260825
Open

chore: fix golangci-lint findings#230
iamlasse wants to merge 2 commits into
marcus:mainfrom
iamlasse:chore/lint-fix-20260825

Conversation

@iamlasse

@iamlasse iamlasse commented Aug 25, 2026

Copy link
Copy Markdown

Summary

Fixes all 4 issues reported by golangci-lint run on c26c5fd:

File Linter Finding Fix
cmd/nightshift/commands/commit.go:55,58 errcheck unchecked fmt.Fprintln error return check the error and return it wrapped; the --check branch and default branch were identical so they are collapsed into a single checked write (unused flag read kept with a clarifying comment)
cmd/nightshift/commands/config.go:373,411 govet inline deprecated reflect.Ptr constant replaced with reflect.Pointer (inline alias) in printStruct and isZero

Validation

Before:

$ golangci-lint run
cmd/nightshift/commands/commit.go:55:3  errcheck: Error return value of `fmt.Fprintln` is not checked
cmd/nightshift/commands/commit.go:58:2  errcheck: Error return value of `fmt.Fprintln` is not checked
cmd/nightshift/commands/config.go:373:9 govet: `reflect.Ptr` is deprecated, use `reflect.Pointer` instead
cmd/nightshift/commands/config.go:411:8 govet: `reflect.Ptr` is deprecated, use `reflect.Pointer` instead

After:

$ make lint
golangci-lint run
0 issues.
  • gofmt -l . — clean
  • go build ./... — passes
  • make test — all packages pass

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
Fix the 4 issues reported by golangci-lint:

- errcheck (commit.go): check the error return of fmt.Fprintln when
printing the normalized commit message. The --check branch and the
default branch were identical, so they are collapsed into a single
checked write; the unused flag read is kept with a clarifying comment. -
govet inline (config.go): replace the deprecated reflect.Ptr constant
with reflect.Pointer (its inline alias) in printStruct and isZero.

golangci-lint run: 4 issues -> 0 issues.

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