Skip to content

Commit

Permalink
build with go1.20 (slackhq#854)
Browse files Browse the repository at this point in the history
* build with go1.20

This has been out for a bit and is up to go1.20.4. We have been using
go1.20 for the Slack builds and have seen no issues.

* need the quotes

* use go install
  • Loading branch information
wadey authored May 4, 2023
1 parent 397fe5f commit 58ec1f7
Show file tree
Hide file tree
Showing 6 changed files with 27 additions and 28 deletions.
15 changes: 7 additions & 8 deletions .github/workflows/gofmt.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,10 @@ jobs:
runs-on: ubuntu-latest
steps:

- name: Set up Go 1.19
- name: Set up Go 1.20
uses: actions/setup-go@v2
with:
go-version: 1.19
go-version: "1.20"
id: go

- name: Check out code into the Go module directory
Expand All @@ -26,19 +26,18 @@ jobs:
- uses: actions/cache@v2
with:
path: ~/go/pkg/mod
key: ${{ runner.os }}-gofmt1.19-${{ hashFiles('**/go.sum') }}
key: ${{ runner.os }}-gofmt1.20-${{ hashFiles('**/go.sum') }}
restore-keys: |
${{ runner.os }}-gofmt1.19-
${{ runner.os }}-gofmt1.20-
- name: Install goimports
run: |
go get golang.org/x/tools/cmd/goimports
go build golang.org/x/tools/cmd/goimports
go install golang.org/x/tools/cmd/goimports@latest
- name: gofmt
run: |
if [ "$(find . -iname '*.go' | grep -v '\.pb\.go$' | xargs ./goimports -l)" ]
if [ "$(find . -iname '*.go' | grep -v '\.pb\.go$' | xargs goimports -l)" ]
then
find . -iname '*.go' | grep -v '\.pb\.go$' | xargs ./goimports -d
find . -iname '*.go' | grep -v '\.pb\.go$' | xargs goimports -d
exit 1
fi
12 changes: 6 additions & 6 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,10 @@ jobs:
name: Build Linux All
runs-on: ubuntu-latest
steps:
- name: Set up Go 1.19
- name: Set up Go 1.20
uses: actions/setup-go@v2
with:
go-version: 1.19
go-version: "1.20"

- name: Checkout code
uses: actions/checkout@v2
Expand All @@ -34,10 +34,10 @@ jobs:
name: Build Windows
runs-on: windows-latest
steps:
- name: Set up Go 1.19
- name: Set up Go 1.20
uses: actions/setup-go@v2
with:
go-version: 1.19
go-version: "1.20"

- name: Checkout code
uses: actions/checkout@v2
Expand Down Expand Up @@ -68,10 +68,10 @@ jobs:
HAS_SIGNING_CREDS: ${{ secrets.AC_USERNAME != '' }}
runs-on: macos-11
steps:
- name: Set up Go 1.19
- name: Set up Go 1.20
uses: actions/setup-go@v2
with:
go-version: 1.19
go-version: "1.20"

- name: Checkout code
uses: actions/checkout@v2
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/smoke.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,10 @@ jobs:
runs-on: ubuntu-latest
steps:

- name: Set up Go 1.19
- name: Set up Go 1.20
uses: actions/setup-go@v2
with:
go-version: 1.19
go-version: "1.20"
id: go

- name: Check out code into the Go module directory
Expand All @@ -30,9 +30,9 @@ jobs:
- uses: actions/cache@v2
with:
path: ~/go/pkg/mod
key: ${{ runner.os }}-go1.19-${{ hashFiles('**/go.sum') }}
key: ${{ runner.os }}-go1.20-${{ hashFiles('**/go.sum') }}
restore-keys: |
${{ runner.os }}-go1.19-
${{ runner.os }}-go1.20-
- name: build
run: make bin-docker
Expand Down
16 changes: 8 additions & 8 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,10 @@ jobs:
runs-on: ubuntu-latest
steps:

- name: Set up Go 1.19
- name: Set up Go 1.20
uses: actions/setup-go@v2
with:
go-version: 1.19
go-version: "1.20"
id: go

- name: Check out code into the Go module directory
Expand All @@ -30,9 +30,9 @@ jobs:
- uses: actions/cache@v2
with:
path: ~/go/pkg/mod
key: ${{ runner.os }}-go1.19-${{ hashFiles('**/go.sum') }}
key: ${{ runner.os }}-go1.20-${{ hashFiles('**/go.sum') }}
restore-keys: |
${{ runner.os }}-go1.19-
${{ runner.os }}-go1.20-
- name: Build
run: make all
Expand Down Expand Up @@ -60,10 +60,10 @@ jobs:
os: [windows-latest, macos-11]
steps:

- name: Set up Go 1.19
- name: Set up Go 1.20
uses: actions/setup-go@v2
with:
go-version: 1.19
go-version: "1.20"
id: go

- name: Check out code into the Go module directory
Expand All @@ -72,9 +72,9 @@ jobs:
- uses: actions/cache@v2
with:
path: ~/go/pkg/mod
key: ${{ runner.os }}-go1.19-${{ hashFiles('**/go.sum') }}
key: ${{ runner.os }}-go1.20-${{ hashFiles('**/go.sum') }}
restore-keys: |
${{ runner.os }}-go1.19-
${{ runner.os }}-go1.20-
- name: Build nebula
run: go build ./cmd/nebula
Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
GOMINVERSION = 1.19
GOMINVERSION = 1.20
NEBULA_CMD_PATH = "./cmd/nebula"
GO111MODULE = on
export GO111MODULE
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/slackhq/nebula

go 1.19
go 1.20

require (
github.com/anmitsu/go-shlex v0.0.0-20200514113438-38f4b401e2be
Expand Down

0 comments on commit 58ec1f7

Please sign in to comment.