Skip to content

Commit cef1273

Browse files
chore: bump to use go1.23 (#485)
* chore: bump to use go1.23 Signed-off-by: Rui Chen <rui@chenrui.dev> * Accept PR comments from #483 * Update lint to fix lint * Keep lint happy * Lengthen timeout --------- Signed-off-by: Rui Chen <rui@chenrui.dev> Co-authored-by: Rui Chen <rui@chenrui.dev>
1 parent f3f0b72 commit cef1273

File tree

9 files changed

+27
-20
lines changed

9 files changed

+27
-20
lines changed

‎.github/workflows/docker.yml

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -34,12 +34,13 @@ jobs:
3434
arch:
3535
- amd64
3636
- arm64
37-
37+
3838
steps:
3939
- uses: actions/checkout@v4
4040
- uses: actions/setup-go@v5
4141
with:
42-
go-version: '1.21'
42+
go-version-file: go.mod
43+
cache-dependency-path: go.sum
4344
- run: GOOS=linux GOARCH=${{ matrix.arch }} make static
4445
- name: Docker meta
4546
id: meta
@@ -57,7 +58,7 @@ jobs:
5758
- name: Login to DockerHub
5859
if: github.event_name != 'pull_request'
5960
uses: grafana/shared-workflows/actions/dockerhub-login@main
60-
61+
6162
- name: Build and push by digest
6263
id: build
6364
uses: docker/build-push-action@v5
@@ -75,7 +76,7 @@ jobs:
7576
run: |
7677
mkdir -p /tmp/digests
7778
digest="${{ steps.build.outputs.digest }}"
78-
touch "/tmp/digests/${digest#sha256:}"
79+
touch "/tmp/digests/${digest#sha256:}"
7980
echo "artifact_name=digests-linux/${{ matrix.arch }}" | sed -e 's/\//-/g' >> "$GITHUB_OUTPUT"
8081
8182
- name: Upload digest
@@ -86,11 +87,11 @@ jobs:
8687
path: /tmp/digests/*
8788
if-no-files-found: error
8889
retention-days: 1
89-
90+
9091
merge:
9192
runs-on: ubuntu-latest
9293
if: github.event_name != 'pull_request'
93-
needs:
94+
needs:
9495
- build
9596
steps:
9697
- name: Download digests (linux/amd64)
@@ -113,7 +114,7 @@ jobs:
113114
114115
- name: Set up Docker Buildx
115116
uses: docker/setup-buildx-action@v3
116-
117+
117118
- name: Docker meta
118119
id: meta
119120
uses: docker/metadata-action@v5
@@ -128,7 +129,7 @@ jobs:
128129
working-directory: /tmp/digests
129130
run: |
130131
docker buildx imagetools create $(jq -cr '.tags | map("-t " + .) | join(" ")' <<< "$DOCKER_METADATA_OUTPUT_JSON") \
131-
$(printf '${{ env.REGISTRY_IMAGE }}@sha256:%s ' *)
132+
$(printf '${{ env.REGISTRY_IMAGE }}@sha256:%s ' *)
132133
- name: Inspect image
133134
run: |
134-
docker buildx imagetools inspect ${{ env.REGISTRY_IMAGE }}:${{ steps.meta.outputs.version }}
135+
docker buildx imagetools inspect ${{ env.REGISTRY_IMAGE }}:${{ steps.meta.outputs.version }}

‎.github/workflows/publish-techdocs.yaml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
name: Publish TechDocs
2+
23
on:
34
push:
45
branches:
@@ -8,9 +9,11 @@ on:
89
- 'mkdocs.yml'
910
- 'catalog-info.yaml'
1011
- '.github/workflows/publish-techdocs.yaml'
12+
1113
concurrency:
1214
group: '${{ github.workflow }}-${{ github.ref }}'
1315
cancel-in-progress: true
16+
1417
jobs:
1518
publish-docs:
1619
uses: grafana/shared-workflows/.github/workflows/publish-techdocs.yaml@main

‎.github/workflows/release-docs.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,4 +27,3 @@ jobs:
2727
with:
2828
github_token: ${{ secrets.GITHUB_TOKEN }}
2929
publish_dir: ./docs/public
30-

‎.github/workflows/release.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,8 @@ jobs:
1717
- uses: actions/checkout@v4
1818
- uses: actions/setup-go@v5
1919
with:
20-
go-version: '1.21'
20+
go-version-file: go.mod
21+
cache-dependency-path: go.sum
2122
- run: make cross
2223
- id: docker_tag
2324
run: echo "DOCKER_TAG=${GITHUB_REF_NAME#v}" >> "$GITHUB_ENV"

‎.github/workflows/tests.yml

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
name: run tests
22

33
on:
4-
pull_request: {}
4+
pull_request:
55

66
jobs:
77
lint:
@@ -10,7 +10,8 @@ jobs:
1010
- uses: actions/checkout@v4
1111
- uses: actions/setup-go@v5
1212
with:
13-
go-version: '1.21'
13+
go-version-file: go.mod
14+
cache-dependency-path: go.sum
1415
- name: Lint
1516
run: make lint
1617
tests:
@@ -19,7 +20,8 @@ jobs:
1920
- uses: actions/checkout@v4
2021
- uses: actions/setup-go@v5
2122
with:
22-
go-version: '1.21'
23+
go-version-file: go.mod
24+
cache-dependency-path: go.sum
2325
- name: Make
2426
run: make test
2527
integration:
@@ -28,6 +30,7 @@ jobs:
2830
- uses: actions/checkout@v4
2931
- uses: actions/setup-go@v5
3032
with:
31-
go-version: '1.21'
33+
go-version-file: go.mod
34+
cache-dependency-path: go.sum
3235
- name: Make
3336
run: make integration

‎Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM golang:1.22.5
1+
FROM golang:1.23.0
22
ARG JSONNET_VERSION=v0.19.1
33
ARG JB_VERSION=v0.5.1
44
RUN CGO_ENABLED=0 go install github.com/google/go-jsonnet/cmd/jsonnet@${JSONNET_VERSION} && \

‎Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ lint:
99
--rm \
1010
--volume "$(shell pwd):/src" \
1111
--workdir "/src" \
12-
golangci/golangci-lint:v1.57 golangci-lint run ./... -v
12+
golangci/golangci-lint:v1.60.3 golangci-lint run ./... -v --timeout 2m
1313

1414
run-test-image-locally: test-clean
1515
$(DOCKER_COMPOSE) up --force-recreate --detach --remove-orphans --wait

‎go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
module github.com/grafana/grizzly
22

3-
go 1.22
3+
go 1.23
44

55
require (
66
github.com/fatih/color v1.15.0

‎pkg/grafana/dashboard-handler.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -332,11 +332,11 @@ func (h *DashboardHandler) RootDashboardPageHandler(s grizzly.Server) http.Handl
332332

333333
if resp.StatusCode == 302 {
334334
w.WriteHeader(http.StatusUnauthorized)
335-
fmt.Fprintf(w, msg+"<p>Authentication error</p>")
335+
fmt.Fprintf(w, "%s<p>Authentication error</p>", msg)
336336
} else {
337337
body, _ := io.ReadAll(resp.Body)
338338
w.WriteHeader(resp.StatusCode)
339-
fmt.Fprintf(w, msg+string(body))
339+
fmt.Fprintf(w, "%s%s", msg, string(body))
340340
}
341341
}
342342
}

0 commit comments

Comments
 (0)