Skip to content

Commit

Permalink
feat: drop support for Go 1.15 (#145)
Browse files Browse the repository at this point in the history
And add support for Go 1.18.
  • Loading branch information
enocom authored Mar 17, 2022
1 parent 0c9f2c7 commit 791641b
Show file tree
Hide file tree
Showing 4 changed files with 41 additions and 4 deletions.
37 changes: 37 additions & 0 deletions .github/update_go.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
# Copyright 2022 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

# update_go.sh updates all GitHub Action workflows to use the provided Go
# version.

usage() {
echo "Missing Go version."
echo "usage: .github/update_go.sh <version>"
echo " Example:"
echo " .github/update_go.sh 1.18"
}

if [ -z "$1" ]
then
usage
fi

# Replace all usages of "go-version: x.xx" with the provided version.
grep -lr "go-version: \"" .github/workflows | xargs \
sed -i "s/go-version: \".*\"/go-version: \"$1\"/g"

# Replace the matrix of Go versions with the last two versions and the provided
# version.
grep -lr "go-version: \[" .github | xargs \
sed -i "s/\[\(.*\), \(.*\), \(.*\)\]/\[\2, \3, $1\]/"
2 changes: 1 addition & 1 deletion .github/workflows/cover.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ jobs:
- name: Setup Go
uses: actions/setup-go@v3
with:
go-version: "1.17"
go-version: "1.18"

- name: Checkout base branch
uses: actions/checkout@v3
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/lint.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,9 @@ jobs:
- name: Setup Go
uses: actions/setup-go@v3
with:
go-version: "1.17"
go-version: "1.18"
- name: Install goimports
run: go get golang.org/x/tools/cmd/goimports
run: go install golang.org/x/tools/cmd/goimports@latest
- name: Checkout code
uses: actions/checkout@v3
- run: goimports -w .
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
go-version: [1.15, 1.16, 1.17]
go-version: [1.16, 1.17, 1.18]
steps:
- name: Setup Go ${{ matrix.go-version }}
uses: actions/setup-go@v3
Expand Down

0 comments on commit 791641b

Please sign in to comment.