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,29 +1,29 @@
package openai_test
import (
. "github.com/sashabaranov/go-openai"
"github.com/sashabaranov/go-openai"
"github.com/sashabaranov/go-openai/internal/test"
)
func setupOpenAITestServer() (client *Client, server *test.ServerTest, teardown func()) {
func setupOpenAITestServer() (client *openai.Client, server *test.ServerTest, teardown func()) {
server = test.NewTestServer()
ts := server.OpenAITestServer()
ts.Start()
teardown = ts.Close
config := DefaultConfig(test.GetTestToken())
config := openai.DefaultConfig(test.GetTestToken())
config.BaseURL = ts.URL + "/v1"
client = NewClientWithConfig(config)
client = openai.NewClientWithConfig(config)
return
}
func setupAzureTestServer() (client *Client, server *test.ServerTest, teardown func()) {
func setupAzureTestServer() (client *openai.Client, server *test.ServerTest, teardown func()) {
server = test.NewTestServer()
ts := server.OpenAITestServer()
ts.Start()
teardown = ts.Close
config := DefaultAzureConfig(test.GetTestToken(), "https://dummylab.openai.azure.com/")
config := openai.DefaultAzureConfig(test.GetTestToken(), "https://dummylab.openai.azure.com/")
config.BaseURL = ts.URL
client = NewClientWithConfig(config)
client = openai.NewClientWithConfig(config)
return
}