diff options
author | Julien Dessaux | 2023-06-19 00:14:41 +0200 |
---|---|---|
committer | Julien Dessaux | 2023-06-19 00:16:15 +0200 |
commit | 3586ed65b73b732295fa3ef63877c89b51ec6e31 (patch) | |
tree | 6f2479e8103bd578bb6ca0d37d23e41799949da9 | |
parent | Prepared everything for the first release (diff) | |
download | terraform-provider-eventline-3586ed65b73b732295fa3ef63877c89b51ec6e31.tar.gz terraform-provider-eventline-3586ed65b73b732295fa3ef63877c89b51ec6e31.tar.bz2 terraform-provider-eventline-3586ed65b73b732295fa3ef63877c89b51ec6e31.zip |
golangci fixes
Diffstat (limited to '')
-rw-r--r-- | external/evcli/client.go | 4 | ||||
-rw-r--r-- | internal/provider/provider.go | 2 |
2 files changed, 3 insertions, 3 deletions
diff --git a/external/evcli/client.go b/external/evcli/client.go index 8127dff..b9d5032 100644 --- a/external/evcli/client.go +++ b/external/evcli/client.go @@ -5,7 +5,6 @@ import ( "encoding/json" "fmt" "io" - "io/ioutil" "net/http" "net/url" @@ -34,6 +33,7 @@ func NewClient(config *APIConfig) (*Client, error) { } if err != nil { + return nil, err } return client, nil @@ -75,7 +75,7 @@ func (c *Client) SendRequest(method string, relURI *url.URL, body, dest interfac } defer res.Body.Close() - resBody, err := ioutil.ReadAll(res.Body) + resBody, err := io.ReadAll(res.Body) if err != nil { return fmt.Errorf("cannot read response body: %w", err) } diff --git a/internal/provider/provider.go b/internal/provider/provider.go index 86f4c7d..a3fe206 100644 --- a/internal/provider/provider.go +++ b/internal/provider/provider.go @@ -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()} client, err := evcli.NewClient(&config) 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 } |