Skip to content

Commit

Permalink
Upgrade to Go 1.19 (#146)
Browse files Browse the repository at this point in the history
  • Loading branch information
patrickhoefler committed Aug 5, 2022
1 parent 62b8503 commit 547f3cb
Show file tree
Hide file tree
Showing 6 changed files with 26 additions and 23 deletions.
30 changes: 16 additions & 14 deletions .github/workflows/lint_and_test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,25 +7,27 @@ jobs:
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@2541b1294d2704b0964813337f33b291d3f8596b # tag=v3
- name: Check out the code
uses: actions/checkout@2541b1294d2704b0964813337f33b291d3f8596b # tag=v3

- name: Set up Go
uses: actions/setup-go@84cbf8094393cdc5fe1fe1671ff2647332956b1a # tag=v3
with:
go-version: '1.18'
go-version-file: 'go.mod'

- name: Run the linters
uses: golangci/golangci-lint-action@537aa1903e5d359d0b27dbc19ddd22c5087f3fbc # tag=v3.2.0

test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@2541b1294d2704b0964813337f33b291d3f8596b # tag=v3
- name: Check out the code
uses: actions/checkout@2541b1294d2704b0964813337f33b291d3f8596b # tag=v3

- name: Set up Go
uses: actions/setup-go@84cbf8094393cdc5fe1fe1671ff2647332956b1a # tag=v3
with:
go-version: '1.18'
go-version-file: 'go.mod'

- name: Install graphviz
run: sudo apt install --no-install-recommends -y graphviz
Expand All @@ -46,13 +48,13 @@ jobs:
runs-on: ${{ matrix.os }}
needs: [lint, test]
steps:
- name: Install Go
- name: Check out the code
uses: actions/checkout@2541b1294d2704b0964813337f33b291d3f8596b # tag=v3

- name: Set up Go
uses: actions/setup-go@84cbf8094393cdc5fe1fe1671ff2647332956b1a # tag=v3
with:
go-version: '1.18'

- name: Checkout code
uses: actions/checkout@2541b1294d2704b0964813337f33b291d3f8596b # tag=v3
go-version-file: 'go.mod'

- name: Build
run: make build
Expand Down Expand Up @@ -80,13 +82,13 @@ jobs:
runs-on: ubuntu-latest
needs: [lint, test]
steps:
- name: Install Go
- name: Check out the code
uses: actions/checkout@2541b1294d2704b0964813337f33b291d3f8596b # tag=v3

- name: Set up Go
uses: actions/setup-go@84cbf8094393cdc5fe1fe1671ff2647332956b1a # tag=v3
with:
go-version: '1.18'

- name: Checkout code
uses: actions/checkout@2541b1294d2704b0964813337f33b291d3f8596b # tag=v3
go-version-file: 'go.mod'

- name: Build binaries and Docker image with GoReleaser
uses: goreleaser/goreleaser-action@68acf3b1adf004ac9c2f0a4259e85c5f66e99bef # tag=v3
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/release.yaml
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@84cbf8094393cdc5fe1fe1671ff2647332956b1a # tag=v3
with:
go-version: '1.18'
go-version-file: 'go.mod'

- name: Login to GitHub Container Registry
uses: docker/login-action@49ed152c8eca782a232dede0303416e8f356c37b # tag=v2
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -19,5 +19,5 @@ require (
github.com/pkg/errors v0.9.1 // indirect
github.com/spf13/pflag v1.0.5 // indirect
golang.org/x/text v0.3.7 // indirect
google.golang.org/protobuf v1.28.0 // indirect
google.golang.org/protobuf v1.28.1 // indirect
)
2 changes: 2 additions & 0 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -452,6 +452,8 @@ google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp0
google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc=
google.golang.org/protobuf v1.28.0 h1:w43yiav+6bVFTBQFZX0r7ipe9JQ1QsbMgHwbBziscLw=
google.golang.org/protobuf v1.28.0/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I=
google.golang.org/protobuf v1.28.1 h1:d0NfwRgPtno5B1Wa6L2DAG+KivqkdutMf1UhdNx175w=
google.golang.org/protobuf v1.28.1/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I=
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
gopkg.in/errgo.v2 v2.1.0/go.mod h1:hNsd1EY+bozCKY1Ytp96fpM3vjJbqLJn88ws8XvfDNI=
Expand Down
3 changes: 1 addition & 2 deletions internal/cmd/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ package cmd
import (
"fmt"
"io"
"io/ioutil"
"os"
"os/exec"
"strings"
Expand Down Expand Up @@ -48,7 +47,7 @@ It outputs a graph representation of the build process.`,
return
}

dotFile, err := ioutil.TempFile("", "dockerfile.*.dot")
dotFile, err := os.CreateTemp("", "dockerfile.*.dot")
if err != nil {
return
}
Expand Down
10 changes: 5 additions & 5 deletions internal/cmd/root_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ RUN \
# ---
FROM golang:1.18 AS build
FROM golang:1.19 AS build
RUN --mount=type=cache,from=buildcache,source=/go/pkg/mod/cache/,target=/go/pkg/mod/cache/ go build
# ---
Expand Down Expand Up @@ -125,7 +125,7 @@ It outputs a graph representation of the build process.
stage_0 -> stage_2 [arrowhead=empty];
external_image_1 [color=grey20,
fontcolor=grey20,
label="golang:1.18",
label="golang:1.19",
shape=Mrecord,
style=dashed,
width=2];
Expand Down Expand Up @@ -209,7 +209,7 @@ It outputs a graph representation of the build process.
margin=16
];
stage_1_layer_0 [fillcolor=white,
label="FROM golang:1.18 ...",
label="FROM golang:1.19 ...",
penwidth=0.5,
shape=Mrecord,
style=filled,
Expand Down Expand Up @@ -269,7 +269,7 @@ It outputs a graph representation of the build process.
ltail=cluster_stage_1];
external_image_1 [color=grey20,
fontcolor=grey20,
label="golang:1.18",
label="golang:1.19",
shape=Mrecord,
style=dashed,
width=2];
Expand Down Expand Up @@ -341,7 +341,7 @@ It outputs a graph representation of the build process.
stage_0 -> stage_2 [arrowhead=empty];
external_image_1 [color=grey20,
fontcolor=grey20,
label="golang:1.18",
label="golang:1.19",
shape=Mrecord,
style=dashed,
width=2];
Expand Down

0 comments on commit 547f3cb

Please sign in to comment.