Skip to content

Commit

Permalink
Upgrade to go 1.18 (#248)
Browse files Browse the repository at this point in the history
  • Loading branch information
peter-evans authored Nov 11, 2022
1 parent d5c9308 commit 71ab251
Show file tree
Hide file tree
Showing 10 changed files with 14 additions and 18 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ jobs:

- uses: actions/setup-go@v3
with:
go-version: 1.17
go-version: 1.18

- uses: actions/cache@v3
with:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
3 changes: 1 addition & 2 deletions cli/config/configure.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ package config
import (
"errors"
"fmt"
"io/ioutil"
"os"
"path/filepath"

Expand Down Expand Up @@ -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)
Expand Down
3 changes: 1 addition & 2 deletions cli/ctl/apply/docparse/docparse.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ import (
"bufio"
"encoding/json"
"fmt"
"io/ioutil"
"os"
"regexp"
"strings"
Expand All @@ -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
}
Expand Down
3 changes: 1 addition & 2 deletions cli/ctl/export/export_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ import (
"encoding/json"
"errors"
"fmt"
"io/ioutil"
"os"
"path/filepath"

Expand Down Expand Up @@ -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
}
}
Expand Down
4 changes: 2 additions & 2 deletions cli/test/tutil/tutil.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
package tutil

import (
"io/ioutil"
"os"
"strings"
"testing"
)
Expand All @@ -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()
Expand Down
7 changes: 3 additions & 4 deletions core/client/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ import (
"crypto/tls"
"crypto/x509"
"fmt"
"io/ioutil"
"net"
"os"
"strings"
Expand Down Expand Up @@ -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)
}
Expand All @@ -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)
}
Expand Down
4 changes: 2 additions & 2 deletions core/test/tutil/tutil.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ package tutil
import (
"crypto/rand"
"encoding/json"
"io/ioutil"
"os"
"reflect"
"strings"
"testing"
Expand All @@ -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()
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
@@ -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
Expand Down

0 comments on commit 71ab251

Please sign in to comment.