Skip to content

Commit 3c57d87

Browse files
Update to Go 1.22
Signed-off-by: Rick Lane <[email protected]>
1 parent ec921e4 commit 3c57d87

File tree

12 files changed

+24
-1197
lines changed

12 files changed

+24
-1197
lines changed

.dockerignore

-1
Original file line numberDiff line numberDiff line change
@@ -7,4 +7,3 @@ DEPENDENCY_LICENSES.md
77
.git
88
.github
99
actions
10-
tools

.github/workflows/qa.yml

+12-11
Original file line numberDiff line numberDiff line change
@@ -11,37 +11,38 @@ jobs:
1111
- macos-latest
1212
#- windows-latest
1313
go_version:
14-
- '1.18.0'
15-
- '1.19.0'
16-
- '1.20.0'
1714
- '1.21.0'
15+
- '1.22.0'
1816
steps:
19-
- uses: actions/checkout@v3
20-
- uses: actions/setup-go@v3
17+
- uses: actions/checkout@v4
18+
- uses: actions/setup-go@v5
2119
with:
2220
go-version: '~${{ matrix.go_version }}'
2321
cache: true
2422
- run: |
2523
if [[ "${{runner.debug}}" == "1" ]]; then
2624
DEBUG_FLAGS="-v"
2725
fi
28-
26+
2927
go test -race ${DEBUG_FLAGS} ./...
3028
lint:
3129
runs-on: ubuntu-latest
3230
steps:
33-
- uses: actions/checkout@v3
34-
- uses: actions/setup-go@v3
31+
- uses: actions/checkout@v4
32+
- uses: actions/setup-go@v5
3533
with:
3634
# Specify the most recent (1.Y.Z) Y release
3735
go-version-file: go.mod
3836
cache: true
39-
- run: make lint
37+
- uses: golangci/golangci-lint-action@v5
38+
with:
39+
version: latest
40+
args: --timeout=10m
4041
generate:
4142
runs-on: ubuntu-latest
4243
steps:
43-
- uses: actions/checkout@v3
44-
- uses: actions/setup-go@v3
44+
- uses: actions/checkout@v4
45+
- uses: actions/setup-go@v5
4546
with:
4647
go-version-file: go.mod
4748
cache: true

.github/workflows/test-action.yml

+8-8
Original file line numberDiff line numberDiff line change
@@ -12,12 +12,12 @@ jobs:
1212
name: "Generate dependency information"
1313
runs-on: ubuntu-latest
1414
steps:
15-
- uses: actions/checkout@v3
15+
- uses: actions/checkout@v4
1616
with:
1717
fetch-depth: 0
1818

1919
- name: Setup Go environment
20-
uses: actions/setup-go@v3
20+
uses: actions/setup-go@v5
2121
with:
2222
go-version-file: go.mod
2323
cache: true
@@ -37,14 +37,14 @@ jobs:
3737
: > DEPENDENCY_LICENSES.md
3838
: > DEPENDENCIES.md
3939
git add DEPENDENCY_LICENSES.md DEPENDENCIES.md
40-
40+
4141
# Generate license information
4242
export GO_IMAGE=$(grep -e 'FROM golang:' "build-aux/docker/go_builder.dockerfile" | cut -d ' ' -f2 )
4343
4444
#Copy test data to another folder since it can't be used from there
4545
cp -a ./test-data ./ui
4646
export NPM_PACKAGES=$( echo -e "./ui/package.json\n./ui/package-lock.json" )
47-
47+
4848
mkdir -p "${BUILD_TMP}"
4949
build-aux/generate.sh --unparsable-packages ./unparsable-packages.yaml
5050
@@ -58,7 +58,7 @@ jobs:
5858
- name: "Check that action didn't do any changes"
5959
run: |
6060
if [[ "${{ steps.changed-by-dependabot.outputs.is_dirty }}" == 'true' ]]; then
61-
echo "::error:: Action indicates that the repo was dirty"
61+
echo "::error:: Action indicates that the repo was dirty"
6262
exit 1
6363
fi
6464
@@ -74,18 +74,18 @@ jobs:
7474
if: github.ref_type == 'branch'
7575
run: |
7676
if [[ "${{ steps.changed-by-dependabot2.outputs.license_information_committed }}" != 'true' ]]; then
77-
echo "::error:: Action indicates that the repo was not dirty"
77+
echo "::error:: Action indicates that the repo was not dirty"
7878
exit 1
7979
fi
8080
8181
DESTINATION_BRANCH="${GITHUB_HEAD_REF:-$GITHUB_REF_NAME}"
8282
DIFF=$(git diff --stat --cached origin/${DESTINATION_BRANCH})
8383
if [[ -z "${DIFF}" ]]; then
84-
echo "::error:: There weren't any files committed."
84+
echo "::error:: There weren't any files committed."
8585
exit 1
8686
fi
8787
8888
if ! grep -e '^\s*DEPENDENCY_LICENSES.md' <(echo "${DIFF}") > /dev/null; then
89-
echo "::error:: File DEPENDENCY_LICENSES.md was not modified, but it should have been."
89+
echo "::error:: File DEPENDENCY_LICENSES.md was not modified, but it should have been."
9090
exit 1
9191
fi

Makefile

-7
Original file line numberDiff line numberDiff line change
@@ -13,13 +13,6 @@ generate:
1313
go generate ./...
1414
.PHONY: generate
1515

16-
lint: tools/bin/golangci-lint
17-
tools/bin/golangci-lint run ./...
18-
.PHONY: lint
19-
20-
tools/bin/%: tools/src/%/pin.go tools/src/%/go.mod
21-
cd $(<D) && GOOS= GOARCH= go build -o $(abspath $@) $$(sed -En 's,^import "(.*)".*,\1,p' pin.go)
22-
2316
.DELETE_ON_ERROR:
2417
.PHONY: FORCE
2518
FORCE:

build-aux/docker/go_builder.dockerfile

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
# Go dependency scanner
33
########################################
44
ARG GO_IMAGE="base-image-unknown"
5-
FROM golang:1.20.12-alpine3.19 as builder
5+
FROM golang:1.22.4-alpine3.20 as builder
66

77
ENV GOCACHE=/root/.cache/go-build
88
RUN mkdir -p "${GOCACHE}"

build-aux/docker/js_builder.dockerfile

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
# builder for Js scanning
33
######################################################################
44
ARG NODE_IMAGE="need-a-base-image"
5-
FROM golang:1.19-alpine3.15 as builder
5+
FROM golang:1.22.4-alpine3.20 as builder
66

77
ENV GOCACHE=/root/.cache/go-build
88
RUN mkdir -p "${GOCACHE}"

build-aux/docker/py_builder.dockerfile

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
# Python dependency scanner
33
########################################
44
ARG PYTHON_IMAGE="need-a-base-image"
5-
FROM golang:1.19-alpine3.15 as builder
5+
FROM golang:1.22.4-alpine3.20 as builder
66

77
WORKDIR /src
88
COPY . ./

go.mod

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
module github.com/datawire/go-mkopensource
22

3-
go 1.21
3+
go 1.22
44

55
require (
66
github.com/datawire/dlib v1.3.1

tools/.gitignore

-1
This file was deleted.

tools/src/golangci-lint/go.mod

-183
This file was deleted.

0 commit comments

Comments
 (0)