Lint with golangci-lint and modernize, run from a Taskfile #5

Merged
mikluko merged 1 commit from lint-newexpr into main 2026-11-19 16:16:13 +00:00
Owner

Summary

-Makefile          lint: go vet ./...
+Taskfile.yaml     lint: golangci-lint run ./...
+.golangci.yaml    standard, gocognit, modernize; gofmt
 .forgejo/workflows/test.yaml
-  make lint
-  make test
+  golangci-lint-action@v9, pinned to v2.15.0
+  setup-task@v2, then task test

intp, floatp and boolp are gone: since Go 1.26 new takes an expression. The float bounds are new(1.0), since new(1) is *int. modernize also flagged errors.As in errors.go, which is now errors.AsType.

Evidence

  • Before: golangci-lint run ./... on main under this config reports 9 issues, all modernize (newexpr, errorsastype)
    After: task lint reports 0 issues, task test passes

Merge Danger

Door: two-way

Blast Radius: CI

This pull request's own checks are the first run of both new CI steps in this repository. The make targets are gone with the Makefile.

## Summary ```diff -Makefile lint: go vet ./... +Taskfile.yaml lint: golangci-lint run ./... +.golangci.yaml standard, gocognit, modernize; gofmt .forgejo/workflows/test.yaml - make lint - make test + golangci-lint-action@v9, pinned to v2.15.0 + setup-task@v2, then task test ``` `intp`, `floatp` and `boolp` are gone: since Go 1.26 `new` takes an expression. The float bounds are `new(1.0)`, since `new(1)` is `*int`. modernize also flagged `errors.As` in `errors.go`, which is now `errors.AsType`. ## Evidence - **Before:** `golangci-lint run ./...` on `main` under this config reports 9 issues, all modernize (`newexpr`, `errorsastype`) **After:** `task lint` reports 0 issues, `task test` passes ## Merge Danger **Door:** two-way **Blast Radius:** CI This pull request's own checks are the first run of both new CI steps in this repository. The `make` targets are gone with the Makefile.
Lint with golangci-lint and modernize, run from a Taskfile
Some checks failed
test / changelog (pull_request) Successful in 4s
test / go (pull_request) Failing after 16s
61e607086f
go vet has no check for the pointer helpers that new(expr) replaced in
Go 1.26; modernize has. The float bounds are new(1.0): new(1) is *int.

Assisted-By: Claude <noreply@anthropic.com>
mikluko referenced this pull request from a commit 2026-11-19 16:17:44 +00:00
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
mikluko/perplexity-mcp!5
No description provided.