diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 482ee663..292c87b8 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -19,7 +19,7 @@ jobs: - uses: actions/setup-go@v3 with: - go-version: 1.17 + go-version: 1.18 - uses: actions/cache@v3 with: diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index 5acecd9d..2df14e7a 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -20,7 +20,7 @@ jobs: - uses: actions/setup-go@v3 with: - go-version: 1.17 + go-version: 1.18 - name: lint uses: golangci/golangci-lint-action@v3 diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index b0a070c4..e59e9314 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -15,7 +15,7 @@ jobs: - uses: actions/setup-go@v3 with: - go-version: 1.17 + go-version: 1.18 - name: Login to Docker Hub uses: docker/login-action@v2 diff --git a/cli/config/configure.go b/cli/config/configure.go index 9050073e..3c01597a 100644 --- a/cli/config/configure.go +++ b/cli/config/configure.go @@ -4,7 +4,6 @@ package config import ( "errors" "fmt" - "io/ioutil" "os" "path/filepath" @@ -90,7 +89,7 @@ func Configure() error { if err := os.MkdirAll(filepath.Dir(configPath), 0o755); err != nil { return fmt.Errorf("failed to create configuration directory: %v", err) } - if err = ioutil.WriteFile(configPath, y, 0o666); err != nil { + if err = os.WriteFile(configPath, y, 0o666); err != nil { return fmt.Errorf("failed to write configuration file: %v", err) } fmt.Printf("\nCreated configuration file at %s\n", configPath) diff --git a/cli/ctl/apply/docparse/docparse.go b/cli/ctl/apply/docparse/docparse.go index 5c4ed1b8..1e0a56b5 100644 --- a/cli/ctl/apply/docparse/docparse.go +++ b/cli/ctl/apply/docparse/docparse.go @@ -5,7 +5,6 @@ import ( "bufio" "encoding/json" "fmt" - "io/ioutil" "os" "regexp" "strings" @@ -27,7 +26,7 @@ var ( // FromFile parses a file to a slice of separated documents. func FromFile(filepath string, format Format) ([]string, error) { - b, err := ioutil.ReadFile(filepath) + b, err := os.ReadFile(filepath) if err != nil { return nil, err } diff --git a/cli/ctl/export/export_controller.go b/cli/ctl/export/export_controller.go index 1ec0f756..23c6df72 100644 --- a/cli/ctl/export/export_controller.go +++ b/cli/ctl/export/export_controller.go @@ -6,7 +6,6 @@ import ( "encoding/json" "errors" "fmt" - "io/ioutil" "os" "path/filepath" @@ -116,7 +115,7 @@ func (e *exportController) Execute(ctx context.Context) error { } log.Infof("Writing %s definition file %q", e.kind, outputPath) - if err = ioutil.WriteFile(outputPath, defDocBytes, 0o666); err != nil { + if err = os.WriteFile(outputPath, defDocBytes, 0o666); err != nil { return err } } diff --git a/cli/test/tutil/tutil.go b/cli/test/tutil/tutil.go index 77574492..5f18eba5 100644 --- a/cli/test/tutil/tutil.go +++ b/cli/test/tutil/tutil.go @@ -2,7 +2,7 @@ package tutil import ( - "io/ioutil" + "os" "strings" "testing" ) @@ -21,7 +21,7 @@ func ErrorContains(out error, want string) bool { // Fixture returns the byte slice of a test fixture. func Fixture(t *testing.T, path string) []byte { t.Helper() - fileBytes, err := ioutil.ReadFile(path) + fileBytes, err := os.ReadFile(path) if err != nil { t.Errorf("failed to load test fixture %q: %v", path, err) t.FailNow() diff --git a/core/client/client.go b/core/client/client.go index 0205e9b3..e7efd912 100644 --- a/core/client/client.go +++ b/core/client/client.go @@ -6,7 +6,6 @@ import ( "crypto/tls" "crypto/x509" "fmt" - "io/ioutil" "net" "os" "strings" @@ -224,7 +223,7 @@ func (cl *Client) buildTLSOpt() error { // Set CA cert. if len(cl.cc.TLS.CACertPath) > 0 { - ca, err := ioutil.ReadFile(cl.cc.TLS.CACertPath) + ca, err := os.ReadFile(cl.cc.TLS.CACertPath) if err != nil { return fmt.Errorf("failed to read CA cert %q: %v", cl.cc.TLS.CACertPath, err) } @@ -239,12 +238,12 @@ func (cl *Client) buildTLSOpt() error { return fmt.Errorf("both client and key cert paths must be provided, but only one found") } - cert, err := ioutil.ReadFile(cl.cc.TLS.ClientCertPath) + cert, err := os.ReadFile(cl.cc.TLS.ClientCertPath) if err != nil { return fmt.Errorf("failed to read client cert %q: %v", cl.cc.TLS.ClientCertPath, err) } - key, err := ioutil.ReadFile(cl.cc.TLS.ClientKeyPath) + key, err := os.ReadFile(cl.cc.TLS.ClientKeyPath) if err != nil { return fmt.Errorf("failed to read client key %q: %v", cl.cc.TLS.ClientKeyPath, err) } diff --git a/core/test/tutil/tutil.go b/core/test/tutil/tutil.go index 853264f4..8cbc22ec 100644 --- a/core/test/tutil/tutil.go +++ b/core/test/tutil/tutil.go @@ -4,7 +4,7 @@ package tutil import ( "crypto/rand" "encoding/json" - "io/ioutil" + "os" "reflect" "strings" "testing" @@ -29,7 +29,7 @@ func ErrorContains(out error, want string) bool { // Fixture returns the byte slice of a test fixture. func Fixture(t *testing.T, path string) []byte { t.Helper() - fileBytes, err := ioutil.ReadFile(path) + fileBytes, err := os.ReadFile(path) if err != nil { t.Errorf("failed to load test fixture %q: %v", path, err) t.FailNow() diff --git a/go.mod b/go.mod index ba24695b..92fa0b39 100644 --- a/go.mod +++ b/go.mod @@ -1,6 +1,6 @@ module github.com/peter-evans/kdef -go 1.17 +go 1.18 require ( github.com/aws/aws-sdk-go v1.44.134