lint: fix linter warnings reported by golangci-lint (#522)

- Fix #519
This commit is contained in:
Simon Klee
2023-11-07 10:23:06 +01:00
committed by GitHub
parent 9e0232f941
commit 0664105387
23 changed files with 425 additions and 431 deletions

View File

@@ -1,17 +1,16 @@
package openai_test
import (
"os"
"time"
. "github.com/sashabaranov/go-openai"
"github.com/sashabaranov/go-openai/internal/test/checks"
"context"
"encoding/json"
"fmt"
"net/http"
"os"
"testing"
"time"
"github.com/sashabaranov/go-openai"
"github.com/sashabaranov/go-openai/internal/test/checks"
)
const testFineTuneModelID = "fine-tune-model-id"
@@ -35,7 +34,7 @@ func TestAzureListModels(t *testing.T) {
// handleListModelsEndpoint Handles the list models endpoint by the test server.
func handleListModelsEndpoint(w http.ResponseWriter, _ *http.Request) {
resBytes, _ := json.Marshal(ModelsList{})
resBytes, _ := json.Marshal(openai.ModelsList{})
fmt.Fprintln(w, string(resBytes))
}
@@ -58,7 +57,7 @@ func TestAzureGetModel(t *testing.T) {
// handleGetModelsEndpoint Handles the get model endpoint by the test server.
func handleGetModelEndpoint(w http.ResponseWriter, _ *http.Request) {
resBytes, _ := json.Marshal(Model{})
resBytes, _ := json.Marshal(openai.Model{})
fmt.Fprintln(w, string(resBytes))
}
@@ -90,6 +89,6 @@ func TestDeleteFineTuneModel(t *testing.T) {
}
func handleDeleteFineTuneModelEndpoint(w http.ResponseWriter, _ *http.Request) {
resBytes, _ := json.Marshal(FineTuneModelDeleteResponse{})
resBytes, _ := json.Marshal(openai.FineTuneModelDeleteResponse{})
fmt.Fprintln(w, string(resBytes))
}