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 #107

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
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
3 changes: 1 addition & 2 deletions internal/pkg/auth/gcr.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ package auth
import (
"encoding/json"
"fmt"
"io/ioutil"
"net/http"
"os"
"time"
Expand Down Expand Up @@ -104,7 +103,7 @@ func hasGoogleMetadataServer() bool {
//
func gcpTokenFromCreds() (string, time.Time, error) {

b, err := ioutil.ReadFile(os.Getenv("GOOGLE_APPLICATION_CREDENTIALS"))
b, err := os.ReadFile(os.Getenv("GOOGLE_APPLICATION_CREDENTIALS"))
if err != nil {
return "", time.Time{}, err
}
Expand Down
3 changes: 1 addition & 2 deletions internal/pkg/relays/docker/docker.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ import (
"context"
"fmt"
"io"
"io/ioutil"
"os"
"time"

Expand Down Expand Up @@ -248,7 +247,7 @@ func (dc *dockerClient) handleLog(rc io.ReadCloser, err error, verbose bool) err
defer rc.Close()
out := dc.wrOut
if !verbose {
out = ioutil.Discard
out = io.Discard
}
terminalFd := os.Stdout.Fd()
isTerminal := dc.wrOut == os.Stdout && terminal.IsTerminal(int(terminalFd))
Expand Down
3 changes: 1 addition & 2 deletions internal/pkg/relays/skopeo/skopeo.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ import (
"encoding/json"
"fmt"
"io"
"io/ioutil"
"os/exec"
"strings"

Expand Down Expand Up @@ -144,7 +143,7 @@ func chooseOutStream(out io.Writer, verbose, isErrorStream bool) io.Writer {
}
return log.StandardLogger().WriterLevel(log.InfoLevel)
}
return ioutil.Discard
return io.Discard
}

//
Expand Down
4 changes: 2 additions & 2 deletions internal/pkg/sync/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@ package sync

import (
"fmt"
"io/ioutil"
"path/filepath"
"os"
"time"

"gopkg.in/yaml.v2"
Expand Down Expand Up @@ -241,7 +241,7 @@ func (c *SyncConfig) isChanged(evt fsnotify.Event) bool {
//
func LoadConfig(file string) (*SyncConfig, error) {

data, err := ioutil.ReadFile(file)
data, err := os.ReadFile(file)

if err != nil {
return nil, fmt.Errorf("error loading config file '%s': %v", file, err)
Expand Down
3 changes: 1 addition & 2 deletions internal/pkg/test/registries/gcp.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ package registries

import (
"fmt"
"io/ioutil"
"os"
"sort"
"testing"
Expand Down Expand Up @@ -90,7 +89,7 @@ func EmptyGARRepo(t *testing.T, p *test.Params) {
// TODO: find out how to remove the repo
func emptyGCPRepo(t *testing.T, repo gcrname.Repository) {

b, err := ioutil.ReadFile(os.Getenv(test.EnvGCPCreds))
b, err := os.ReadFile(os.Getenv(test.EnvGCPCreds))
if err != nil {
t.Fatal(err)
}
Expand Down