Skip to content

Commit

Permalink
chore: update go version to 1.21
Browse files Browse the repository at this point in the history
  • Loading branch information
werne2j committed Oct 20, 2023
1 parent 51238d8 commit 6f4a0f5
Show file tree
Hide file tree
Showing 16 changed files with 747 additions and 2,201 deletions.
2 changes: 1 addition & 1 deletion .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ Please make sure that your PR fulfills the following requirements:
- [ ] Reviewed the guidelines for contributing to this repository
- [ ] The commit message follows the [Conventional Commits Guidelines](https://www.conventionalcommits.org/en/v1.0.0/#summary).
- [ ] Tests for the changes have been updated
- [ ] Are you adding dependencies? If so, please run `go mod tidy -compat=1.17` to ensure only the minimum is pulled in.
- [ ] Are you adding dependencies? If so, please run `go mod tidy -compat=1.21` to ensure only the minimum is pulled in.
- [ ] Docs have been added / updated
- [ ] Optional. My organization is added to USERS.md.

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/pipeline.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ jobs:
- name: Set up Go
uses: actions/setup-go@v4
with:
go-version: 1.17.8
go-version: 1.21

- name: Quality checks
run: make quality
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ jobs:
- name: Set up Go
uses: actions/setup-go@v4
with:
go-version: 1.17.8
go-version: 1.21

- name: Install git-chglog
run: go install github.com/git-chglog/git-chglog/cmd/git-chglog@latest
Expand Down
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM index.docker.io/golang:1.17@sha256:55636cf1983628109e569690596b85077f45aca810a77904e8afad48b49aa500
FROM index.docker.io/golang:1.21

ADD go.mod go.mod
ADD go.sum go.sum
Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ quality:
go test -race -v -coverprofile cover.out ./...

build:
go build -o ${BINARY} .
go build -buildvcs=false -o ${BINARY} .

install: build

Expand Down
34 changes: 17 additions & 17 deletions cmd/generate_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ package cmd

import (
"bytes"
"io/ioutil"
"io"
"os"
"strings"
"testing"
Expand Down Expand Up @@ -34,7 +34,7 @@ func TestMain(t *testing.T) {
cmd.SetErr(c)
cmd.SetOut(bytes.NewBufferString(""))
cmd.Execute()
out, err := ioutil.ReadAll(c) // Read buffer to bytes
out, err := io.ReadAll(c) // Read buffer to bytes
if err != nil {
t.Fatal(err)
}
Expand All @@ -54,7 +54,7 @@ func TestMain(t *testing.T) {
cmd.SetErr(b)
cmd.SetOut(bytes.NewBufferString(""))
cmd.Execute()
out, err := ioutil.ReadAll(b) // Read buffer to bytes
out, err := io.ReadAll(b) // Read buffer to bytes
if err != nil {
t.Fatal(err)
}
Expand All @@ -75,7 +75,7 @@ func TestMain(t *testing.T) {
cmd.SetErr(b)
cmd.SetOut(bytes.NewBufferString(""))
cmd.Execute()
out, err := ioutil.ReadAll(b) // Read buffer to bytes
out, err := io.ReadAll(b) // Read buffer to bytes
if err != nil {
t.Fatal(err)
}
Expand All @@ -88,7 +88,7 @@ func TestMain(t *testing.T) {
// From stdin
args = []string{"-"}
stdin := bytes.NewBufferString("")
inputBuf, err := ioutil.ReadFile("../fixtures/input/empty/file.yaml")
inputBuf, err := os.ReadFile("../fixtures/input/empty/file.yaml")
if err != nil {
t.Fatal(err)
}
Expand All @@ -100,7 +100,7 @@ func TestMain(t *testing.T) {
cmd.SetErr(b)
cmd.SetOut(bytes.NewBufferString(""))
cmd.Execute()
out, err = ioutil.ReadAll(b) // Read buffer to bytes
out, err = io.ReadAll(b) // Read buffer to bytes
if err != nil {
t.Fatal(err)
}
Expand All @@ -120,16 +120,16 @@ func TestMain(t *testing.T) {
cmd.SetOut(b)
cmd.SetErr(e)
cmd.Execute()
out, err := ioutil.ReadAll(b) // Read buffer to bytes
out, err := io.ReadAll(b) // Read buffer to bytes
if err != nil {
t.Fatal(err)
}
stderr, err := ioutil.ReadAll(e) // Read buffer to bytes
stderr, err := io.ReadAll(e) // Read buffer to bytes
if err != nil {
t.Fatal(err)
}

buf, err := ioutil.ReadFile("../fixtures/output/all.yaml")
buf, err := os.ReadFile("../fixtures/output/all.yaml")
if err != nil {
t.Fatal(err)
}
Expand All @@ -148,12 +148,12 @@ func TestMain(t *testing.T) {
cmd.SetArgs(args)
cmd.SetOut(b)
cmd.Execute()
out, err := ioutil.ReadAll(b) // Read buffer to bytes
out, err := io.ReadAll(b) // Read buffer to bytes
if err != nil {
t.Fatal(err)
}

buf, err := ioutil.ReadFile("../fixtures/output/ignored-secret.yaml")
buf, err := os.ReadFile("../fixtures/output/ignored-secret.yaml")
if err != nil {
t.Fatal(err)
}
Expand All @@ -166,7 +166,7 @@ func TestMain(t *testing.T) {

t.Run("will read from STDIN", func(t *testing.T) {
stdin := bytes.NewBufferString("")
inputBuf, err := ioutil.ReadFile("../fixtures/input/nonempty/full.yaml")
inputBuf, err := os.ReadFile("../fixtures/input/nonempty/full.yaml")
if err != nil {
t.Fatal(err)
}
Expand All @@ -180,12 +180,12 @@ func TestMain(t *testing.T) {
cmd.SetOut(stdout)
cmd.SetIn(stdin)
cmd.Execute()
out, err := ioutil.ReadAll(stdout) // Read buffer to bytes
out, err := io.ReadAll(stdout) // Read buffer to bytes
if err != nil {
t.Fatal(err)
}

buf, err := ioutil.ReadFile("../fixtures/output/stdin-full.yaml")
buf, err := os.ReadFile("../fixtures/output/stdin-full.yaml")
if err != nil {
t.Fatal(err)
}
Expand All @@ -198,7 +198,7 @@ func TestMain(t *testing.T) {

t.Run("will return invalid yaml error from STDIN", func(t *testing.T) {
stdin := bytes.NewBufferString("")
inputBuf, err := ioutil.ReadFile("../fixtures/input/invalid.yaml")
inputBuf, err := os.ReadFile("../fixtures/input/invalid.yaml")
if err != nil {
t.Fatal(err)
}
Expand All @@ -213,7 +213,7 @@ func TestMain(t *testing.T) {
cmd.SetOut(bytes.NewBufferString(""))
cmd.SetIn(stdin)
cmd.Execute()
out, err := ioutil.ReadAll(stderr) // Read buffer to bytes
out, err := io.ReadAll(stderr) // Read buffer to bytes
if err != nil {
t.Fatal(err)
}
Expand All @@ -239,7 +239,7 @@ func TestMain(t *testing.T) {
cmd.SetErr(b)
cmd.SetOut(bytes.NewBufferString(""))
cmd.Execute()
out, err := ioutil.ReadAll(b) // Read buffer to bytes
out, err := io.ReadAll(b) // Read buffer to bytes
if err != nil {
t.Fatal(err)
}
Expand Down
3 changes: 1 addition & 2 deletions cmd/util.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import (
"bytes"
"fmt"
"io"
"io/ioutil"
"os"
"path/filepath"

Expand All @@ -30,7 +29,7 @@ func listFiles(root string) ([]string, error) {

func readFilesAsManifests(paths []string) (result []unstructured.Unstructured, errs []error) {
for _, path := range paths {
rawdata, err := ioutil.ReadFile(path)
rawdata, err := os.ReadFile(path)
if err != nil {
errs = append(errs, fmt.Errorf("could not read file: %s from disk: %s", path, err))
}
Expand Down
4 changes: 2 additions & 2 deletions cmd/version_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ package cmd

import (
"bytes"
"io/ioutil"
"io"
"strings"
"testing"

Expand All @@ -22,7 +22,7 @@ func TestVersion(t *testing.T) {
cmd.SetArgs(args)
cmd.SetOut(c)
cmd.Execute()
out, err := ioutil.ReadAll(c) // Read buffer to bytes
out, err := io.ReadAll(c) // Read buffer to bytes
if err != nil {
t.Fatal(err)
}
Expand Down
Loading

0 comments on commit 6f4a0f5

Please sign in to comment.