Selaa lähdekoodia

gofmt, goimports

Michael Yang 11 kuukautta sitten
vanhempi
commit
6297f85606
5 muutettua tiedostoa jossa 9 lisäystä ja 8 poistoa
  1. 2 2
      .github/workflows/test.yaml
  2. 3 2
      .golangci.yaml
  3. 1 1
      llm/memory.go
  4. 1 1
      server/images.go
  5. 2 2
      types/model/name_test.go

+ 2 - 2
.github/workflows/test.yaml

@@ -269,9 +269,9 @@ jobs:
           mkdir -p llm/build/darwin/$ARCH/stub/bin
           touch llm/build/darwin/$ARCH/stub/bin/ollama_llama_server
         if: ${{ startsWith(matrix.os, 'macos-') }}
-      - uses: golangci/golangci-lint-action@v4
+      - uses: golangci/golangci-lint-action@v6
         with:
-          args: --timeout 8m0s -v
+          args: --timeout 8m0s -v ${{ startsWith(matrix.os, 'windows-') && '' || '--disable gofmt --disable goimports' }}
   test:
     strategy:
       matrix:

+ 3 - 2
.golangci.yaml

@@ -9,8 +9,9 @@ linters:
     - contextcheck
     - exportloopref
     - gocheckcompilerdirectives
-    - gofmt
-    - goimports
+    # conditionally enable this on linux/macos
+    # - gofmt
+    # - goimports
     - intrange
     - misspell
     - nilerr

+ 1 - 1
llm/memory.go

@@ -5,9 +5,9 @@ import (
 	"log/slog"
 
 	"github.com/ollama/ollama/api"
+	"github.com/ollama/ollama/envconfig"
 	"github.com/ollama/ollama/format"
 	"github.com/ollama/ollama/gpu"
-	"github.com/ollama/ollama/envconfig"
 )
 
 // This algorithm looks for a complete fit to determine if we need to unload other models

+ 1 - 1
server/images.go

@@ -24,10 +24,10 @@ import (
 
 	"github.com/ollama/ollama/api"
 	"github.com/ollama/ollama/auth"
+	"github.com/ollama/ollama/envconfig"
 	"github.com/ollama/ollama/format"
 	"github.com/ollama/ollama/llm"
 	"github.com/ollama/ollama/parser"
-	"github.com/ollama/ollama/envconfig"
 	"github.com/ollama/ollama/types/errtypes"
 	"github.com/ollama/ollama/types/model"
 	"github.com/ollama/ollama/version"

+ 2 - 2
types/model/name_test.go

@@ -386,8 +386,8 @@ func FuzzName(f *testing.F) {
 
 func TestIsValidNamespace(t *testing.T) {
 	cases := []struct {
-		username   string
-		expected   bool
+		username string
+		expected bool
 	}{
 		{"", false},
 		{"a", true},