[PR #4570] [MERGED] lint some of the things #16800

Closed
opened 2026-04-16 05:43:30 -05:00 by GiteaMirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/ollama/ollama/pull/4570
Author: @mxyng
Created: 5/22/2024
Status: Merged
Merged: 6/4/2024
Merged by: @mxyng

Base: mainHead: mxyng/slices


📝 Commits (10+)

📊 Changes

54 files changed (+237 additions, -242 deletions)

View changed files

📝 .github/workflows/test.yaml (+2 -2)
📝 .golangci.yaml (+18 -1)
📝 api/types.go (+1 -1)
📝 api/types_test.go (+4 -4)
📝 app/lifecycle/paths.go (+0 -1)
📝 app/lifecycle/server.go (+1 -2)
📝 app/lifecycle/server_windows.go (+4 -2)
📝 app/lifecycle/updater.go (+3 -3)
📝 app/store/store.go (+0 -1)
📝 app/tray/wintray/eventloop.go (+2 -3)
📝 app/tray/wintray/tray.go (+3 -7)
📝 cmd/cmd.go (+1 -20)
📝 cmd/interactive.go (+1 -1)
📝 cmd/interactive_test.go (+5 -4)
cmd/start.go (+27 -0)
📝 convert/convert.go (+1 -1)
📝 convert/gemma.go (+0 -1)
📝 convert/llama.go (+4 -3)
📝 convert/safetensors.go (+1 -1)
📝 convert/tokenizer.go (+2 -5)

...and 34 more files

📄 Description

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

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/ollama/ollama/pull/4570 **Author:** [@mxyng](https://github.com/mxyng) **Created:** 5/22/2024 **Status:** ✅ Merged **Merged:** 6/4/2024 **Merged by:** [@mxyng](https://github.com/mxyng) **Base:** `main` ← **Head:** `mxyng/slices` --- ### 📝 Commits (10+) - [`04f3c12`](https://github.com/ollama/ollama/commit/04f3c12bb716ca763da61cb25884c8859ff81240) replace x/exp/slices with slices - [`55f6eba`](https://github.com/ollama/ollama/commit/55f6eba049ec588baf895dc82afcd809b9acedd3) gofmt - [`8ffb517`](https://github.com/ollama/ollama/commit/8ffb51749f7d5f37bb123e50f3c08b4cb50dc693) nolintlint - [`dad7a98`](https://github.com/ollama/ollama/commit/dad7a987ae93a41751a069394dd6c53e92fec138) nosprintfhostport - [`c895a7d`](https://github.com/ollama/ollama/commit/c895a7d13f74c66aee4c68aed75aaeddb7fbcf18) some gocritic - [`e40145a`](https://github.com/ollama/ollama/commit/e40145a39df0fc8bd6e98ca382806fb02daf8ae1) lint - [`201d853`](https://github.com/ollama/ollama/commit/201d853fdf4d08bdbf0c7e58087ba5d574feace1) nolintlint - [`f38353d`](https://github.com/ollama/ollama/commit/f38353d6b91cf9c4f9c086eddfa6d337172d281f) stdin.fd - [`bf7edb0`](https://github.com/ollama/ollama/commit/bf7edb0d5d1a52bab51d83d1558762ad9eb3dc81) lint linux - [`e919f68`](https://github.com/ollama/ollama/commit/e919f6811f7933b120f783e5003727c91dae467f) lint windows ### 📊 Changes **54 files changed** (+237 additions, -242 deletions) <details> <summary>View changed files</summary> 📝 `.github/workflows/test.yaml` (+2 -2) 📝 `.golangci.yaml` (+18 -1) 📝 `api/types.go` (+1 -1) 📝 `api/types_test.go` (+4 -4) 📝 `app/lifecycle/paths.go` (+0 -1) 📝 `app/lifecycle/server.go` (+1 -2) 📝 `app/lifecycle/server_windows.go` (+4 -2) 📝 `app/lifecycle/updater.go` (+3 -3) 📝 `app/store/store.go` (+0 -1) 📝 `app/tray/wintray/eventloop.go` (+2 -3) 📝 `app/tray/wintray/tray.go` (+3 -7) 📝 `cmd/cmd.go` (+1 -20) 📝 `cmd/interactive.go` (+1 -1) 📝 `cmd/interactive_test.go` (+5 -4) ➕ `cmd/start.go` (+27 -0) 📝 `convert/convert.go` (+1 -1) 📝 `convert/gemma.go` (+0 -1) 📝 `convert/llama.go` (+4 -3) 📝 `convert/safetensors.go` (+1 -1) 📝 `convert/tokenizer.go` (+2 -5) _...and 34 more files_ </details> ### 📄 Description 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 --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
GiteaMirror added the pull-request label 2026-04-16 05:43:30 -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#16800