[PR #4570] lint some of the things #11529

Closed
opened 2026-04-12 23:31:51 -05:00 by GiteaMirror · 0 comments
Owner

Original Pull Request: https://github.com/ollama/ollama/pull/4570

State: closed
Merged: Yes


now that ollama uses go1.22, x/exp/slices can be replaced with regular slices

enable some useful linters:

  • intrange is a 1.22 feature which simplifies for i := 0; i < n; i++ { } with for i := range n { }
  • testifylint to find bad testify assertions
  • unconvert to find unnecessary type conversions
  • usestdlibvars to find values that can be replaced with stdlib vars, e.g. OPTIONS with http.MethodOptions
  • wastedassign to find unnecessary assignments
  • whitespace is find unnecessary line
**Original Pull Request:** https://github.com/ollama/ollama/pull/4570 **State:** closed **Merged:** Yes --- now that ollama uses go1.22, `x/exp/slices` can be replaced with regular `slices` enable some useful linters: - intrange is a 1.22 feature which simplifies `for i := 0; i < n; i++ { }` with `for i := range n { }` - testifylint to find bad testify assertions - unconvert to find unnecessary type conversions - ~usestdlibvars to find values that can be replaced with stdlib vars, e.g. `OPTIONS` with `http.MethodOptions`~ - wastedassign to find unnecessary assignments - whitespace is find unnecessary line
GiteaMirror added the pull-request label 2026-04-12 23:31:51 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/ollama#11529