Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: remove refs to deprecated io/ioutil #111

Merged
merged 1 commit into from
Oct 10, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions pkg/client/acr/acr.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import (
"encoding/json"
"errors"
"fmt"
"io/ioutil"
"io"
"net/http"
"sync"
"time"
Expand Down Expand Up @@ -140,7 +140,7 @@ func (c *Client) getManifestsWithClient(ctx context.Context, client *acrClient,
}

if resp.StatusCode != 200 {
body, err := ioutil.ReadAll(resp.Body)
body, err := io.ReadAll(resp.Body)
if err != nil {
return nil, fmt.Errorf("bad request for image host %s", host)
}
Expand Down
6 changes: 3 additions & 3 deletions pkg/client/docker/docker.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import (
"encoding/json"
"errors"
"fmt"
"io/ioutil"
"io"
"net/http"
"strings"
"time"
Expand Down Expand Up @@ -138,7 +138,7 @@ func (c *Client) doRequest(ctx context.Context, url string) (*TagResponse, error
return nil, fmt.Errorf("failed to get docker image: %s", err)
}

body, err := ioutil.ReadAll(resp.Body)
body, err := io.ReadAll(resp.Body)
if err != nil {
return nil, err
}
Expand Down Expand Up @@ -171,7 +171,7 @@ func basicAuthSetup(ctx context.Context, client *http.Client, opts Options) (str
return "", err
}

body, err := ioutil.ReadAll(resp.Body)
body, err := io.ReadAll(resp.Body)
if err != nil {
return "", err
}
Expand Down
4 changes: 2 additions & 2 deletions pkg/client/gcr/gcr.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import (
"context"
"encoding/json"
"fmt"
"io/ioutil"
"io"
"net/http"
"strconv"
"time"
Expand Down Expand Up @@ -70,7 +70,7 @@ func (c *Client) Tags(ctx context.Context, host, repo, image string) ([]api.Imag
return nil, fmt.Errorf("failed to get docker image: %s", err)
}

body, err := ioutil.ReadAll(resp.Body)
body, err := io.ReadAll(resp.Body)
if err != nil {
return nil, err
}
Expand Down
9 changes: 5 additions & 4 deletions pkg/client/selfhosted/selfhosted.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,9 @@ import (
"encoding/json"
"errors"
"fmt"
"io/ioutil"
"io"
"net/http"
"os"
"regexp"
"strings"
"time"
Expand Down Expand Up @@ -228,7 +229,7 @@ func (c *Client) doRequest(ctx context.Context, url, header string, obj interfac
return nil, fmt.Errorf("failed to get docker image: %s", err)
}

body, err := ioutil.ReadAll(resp.Body)
body, err := io.ReadAll(resp.Body)
if err != nil {
return nil, err
}
Expand Down Expand Up @@ -267,7 +268,7 @@ func (c *Client) setupBasicAuth(ctx context.Context, url, tokenPath string) (str
req.URL, err)
}

body, err := ioutil.ReadAll(resp.Body)
body, err := io.ReadAll(resp.Body)
if err != nil {
return "", err
}
Expand All @@ -292,7 +293,7 @@ func newTLSConfig(insecure bool, CAPath string) (*tls.Config, error) {
}

if CAPath != "" {
certs, err := ioutil.ReadFile(CAPath)
certs, err := os.ReadFile(CAPath)
if err != nil {
return nil, fmt.Errorf("Failed to append %q to RootCAs: %v", CAPath, err)
}
Expand Down
Loading