golangci fixes
This commit is contained in:
parent
18ae275c5b
commit
3586ed65b7
2 changed files with 3 additions and 3 deletions
4
external/evcli/client.go
vendored
4
external/evcli/client.go
vendored
|
@ -5,7 +5,6 @@ import (
|
||||||
"encoding/json"
|
"encoding/json"
|
||||||
"fmt"
|
"fmt"
|
||||||
"io"
|
"io"
|
||||||
"io/ioutil"
|
|
||||||
"net/http"
|
"net/http"
|
||||||
"net/url"
|
"net/url"
|
||||||
|
|
||||||
|
@ -34,6 +33,7 @@ func NewClient(config *APIConfig) (*Client, error) {
|
||||||
}
|
}
|
||||||
|
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
}
|
}
|
||||||
|
|
||||||
return client, nil
|
return client, nil
|
||||||
|
@ -75,7 +75,7 @@ func (c *Client) SendRequest(method string, relURI *url.URL, body, dest interfac
|
||||||
}
|
}
|
||||||
defer res.Body.Close()
|
defer res.Body.Close()
|
||||||
|
|
||||||
resBody, err := ioutil.ReadAll(res.Body)
|
resBody, err := io.ReadAll(res.Body)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return fmt.Errorf("cannot read response body: %w", err)
|
return fmt.Errorf("cannot read response body: %w", err)
|
||||||
}
|
}
|
||||||
|
|
|
@ -60,7 +60,7 @@ func (p *Provider) Configure(ctx context.Context, req provider.ConfigureRequest,
|
||||||
config := evcli.APIConfig{Endpoint: data.Endpoint.ValueString(), Key: data.ApiKey.ValueString()}
|
config := evcli.APIConfig{Endpoint: data.Endpoint.ValueString(), Key: data.ApiKey.ValueString()}
|
||||||
client, err := evcli.NewClient(&config)
|
client, err := evcli.NewClient(&config)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
resp.Diagnostics.AddError("new api client", fmt.Sprintf("Unable to instanciate eventline api client, got error: %s", err))
|
resp.Diagnostics.AddError("new api client", fmt.Sprintf("Unable to instantiate eventline api client, got error: %s", err))
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue