Skip to content

Commit

Permalink
chore: enable usestdlibvars linter (#2850)
Browse files Browse the repository at this point in the history
Signed-off-by: Matthieu MOREL <[email protected]>
Co-authored-by: Manuel de la Peña <[email protected]>
Co-authored-by: Steven Hartland <[email protected]>
  • Loading branch information
3 people authored Oct 28, 2024
1 parent 66f17a7 commit 9ed332a
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 4 deletions.
1 change: 1 addition & 0 deletions .golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ linters:
- nakedret
- testifylint
- thelper
- usestdlibvars

linters-settings:
nakedret:
Expand Down
4 changes: 2 additions & 2 deletions modules/elasticsearch/elasticsearch_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ func TestElasticsearch(t *testing.T) {

httpClient := configureHTTPClient(esContainer)

req, err := http.NewRequest("GET", esContainer.Settings.Address, nil)
req, err := http.NewRequest(http.MethodGet, esContainer.Settings.Address, nil)
require.NoError(t, err)

// set the password for the request using the Authentication header
Expand Down Expand Up @@ -201,7 +201,7 @@ func TestElasticsearch8WithoutCredentials(t *testing.T) {

httpClient := configureHTTPClient(ctr)

req, err := http.NewRequest("GET", ctr.Settings.Address, nil)
req, err := http.NewRequest(http.MethodGet, ctr.Settings.Address, nil)
require.NoError(t, err)

// elastic:changeme are the default credentials for Elasticsearch 8
Expand Down
2 changes: 1 addition & 1 deletion modules/ollama/examples_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ func ExampleRun_withModel_llama2_http() {
"prompt":"Why is the sky blue?"
}`

req, err := http.NewRequest("POST", fmt.Sprintf("%s/api/generate", connectionStr), strings.NewReader(payload))
req, err := http.NewRequest(http.MethodPost, fmt.Sprintf("%s/api/generate", connectionStr), strings.NewReader(payload))
if err != nil {
log.Printf("failed to create request: %s", err)
return
Expand Down
2 changes: 1 addition & 1 deletion modules/opensearch/opensearch_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ func TestOpenSearch(t *testing.T) {

client := &http.Client{}

req, err := http.NewRequest("GET", address, nil)
req, err := http.NewRequest(http.MethodGet, address, nil)
require.NoError(t, err)

resp, err := client.Do(req)
Expand Down

0 comments on commit 9ed332a

Please sign in to comment.