Skip to content

golangci-lint: add prealloc as a linter - #3085

Open
christiandins wants to merge 1 commit into
go-task:mainfrom
christiandins:perf/add-prealloc-linnter
Open

christiandins wants to merge 1 commit into
go-task:mainfrom
christiandins:perf/add-prealloc-linnter

Conversation

@christiandins

Copy link
Copy Markdown
Contributor

Description

Enable prealloc in the golangci-lint configuration. prealloc is a Go static analysis tool that identifies slice declarations that could potentially be preallocated, helping highlight opportunities to reduce allocations.
https://golangci-lint.run/docs/linters/configuration/#prealloc

This PR also includes related lint cleanup:

  • Simplify recursive glob parsing with strings.Cut
  • Close HTTP response bodies immediately after each fallback probe in RemoteExists, rather than deferring cleanup until the function returns.
  • Exclude gosec’s G704 SSRF check, with a comment documenting the rationale for user-configured remote Taskfile URLs

Checklist

  • I have read and followed the Contribution Guide.
  • I have disclosed the use of any AI-generated content in this pull request per the AI Usage Policy.
  • I fully understand the changes and have hand-written the description (No AI) of this pull request.

This branch has not been deployed

No deployments
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