Skip to content

Commit f93c7b3

Browse files
committed
deploy,devtools: upgrade to go1.20rc3
- Disabled staticcheck while go1.20 is unsupported. - Fixed out of bounds error in doc html parsing. - Fixed test issue related to rand package changes. Change-Id: Ib7b30ed9c40505a5a51d986426f0e41e53a298b1 Reviewed-on: https://go-review.googlesource.com/c/pkgsite/+/464296 TryBot-Result: kokoro <[email protected]> Reviewed-by: Hyang-Ah Hana Kim <[email protected]> Run-TryBot: Jamal Carvalho <[email protected]>
1 parent 035bfc0 commit f93c7b3

File tree

8 files changed

+21
-16
lines changed

8 files changed

+21
-16
lines changed

all.bash

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,8 @@ check_vet() {
149149
# check_staticcheck runs staticcheck on source files.
150150
check_staticcheck() {
151151
ensure_go_binary honnef.co/go/tools/cmd/staticcheck
152-
runcmd staticcheck $(go list ./... | grep -v third_party | grep -v internal/doc | grep -v internal/render)
152+
# runcmd staticcheck $(go list ./... | grep -v third_party | grep -v internal/doc | grep -v internal/render)
153+
echo "disabling staticcheck until go1.20 is supported"
153154
}
154155

155156
# check_misspell runs misspell on source files.

deploy/deploy-env.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ steps:
2222
args:
2323
- $PROJECT_ID
2424
- id: Check redistributable
25-
name: golang:1.19
25+
name: golang:1.20rc3
2626
entrypoint: private/devtools/check_redist.sh
2727
- id: Build
2828
name: gcr.io/cloud-builders/docker
@@ -48,7 +48,7 @@ steps:
4848
- -c
4949
- deploy/frontend.sh $_ENV gcr.io/$PROJECT_ID/frontend:$(cat _BUILD_TAG)
5050
- id: Pagecheck
51-
name: golang:1.19
51+
name: golang:1.20rc3
5252
entrypoint: deploy/pagecheck.sh
5353
args:
5454
- $_ENV

deploy/deploy.yaml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ steps:
2222
args:
2323
- $PROJECT_ID
2424
- id: Check redistributable
25-
name: golang:1.19
25+
name: golang:1.20rc3
2626
entrypoint: private/devtools/check_redist.sh
2727
- id: Build
2828
name: gcr.io/cloud-builders/docker
@@ -48,7 +48,7 @@ steps:
4848
- -c
4949
- deploy/frontend.sh staging gcr.io/$PROJECT_ID/frontend:$(cat _BUILD_TAG)
5050
- id: Pagecheck - staging
51-
name: golang:1.19
51+
name: golang:1.20rc3
5252
entrypoint: deploy/pagecheck.sh
5353
args:
5454
- staging
@@ -77,7 +77,7 @@ steps:
7777
- -c
7878
- deploy/frontend.sh prod gcr.io/$PROJECT_ID/frontend:$(cat _BUILD_TAG)
7979
- id: Pagecheck - prod
80-
name: golang:1.19
80+
name: golang:1.20rc3
8181
entrypoint: deploy/pagecheck.sh
8282
args:
8383
- prod
@@ -88,7 +88,7 @@ steps:
8888
- -c
8989
- deploy/frontend.sh beta gcr.io/$PROJECT_ID/frontend:$(cat _BUILD_TAG)
9090
- id: Pagecheck - beta
91-
name: golang:1.19
91+
name: golang:1.20rc3
9292
entrypoint: deploy/pagecheck.sh
9393
args:
9494
- beta

deploy/migrate.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ steps:
1616
args:
1717
- $PROJECT_ID
1818
- id: Migrate
19-
name: golang:1.19
19+
name: golang:1.20rc3
2020
entrypoint: bash
2121
dir: private
2222
args:

deploy/sitemap.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ steps:
99
args:
1010
- $PROJECT_ID
1111
- id: Build
12-
name: golang:1.19
12+
name: golang:1.20rc3
1313
entrypoint: bash
1414
dir: private
1515
args:

devtools/docker/compose.yaml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ services:
3131
depends_on:
3232
- db
3333
# This should match the version we are using on Cloud Run.
34-
image: golang:1.19
34+
image: golang:1.20rc3
3535
environment:
3636
<<: *database-variables
3737
<<: *go-variables
@@ -44,7 +44,7 @@ services:
4444
- ../../:/pkgsite
4545
working_dir: /pkgsite
4646
searchtest:
47-
image: golang:1.19
47+
image: golang:1.20rc3
4848
depends_on:
4949
- frontend
5050
environment:
@@ -57,7 +57,7 @@ services:
5757
- ../../:/pkgsite
5858
working_dir: /pkgsite
5959
api:
60-
image: golang:1.19
60+
image: golang:1.20rc3
6161
depends_on:
6262
- frontend
6363
environment:
@@ -70,7 +70,7 @@ services:
7070
working_dir: /pkgsite
7171
frontend:
7272
# This should match the version we are using on AppEngine.
73-
image: golang:1.19
73+
image: golang:1.20rc3
7474
depends_on:
7575
- db
7676
command: bash -c "
@@ -89,7 +89,7 @@ services:
8989
working_dir: /pkgsite
9090
seeddb:
9191
# This should match the version we are using on Cloud Run.
92-
image: golang:1.19
92+
image: golang:1.20rc3
9393
depends_on:
9494
- db
9595
# Note: technically we should check that migrations have completed before
@@ -142,7 +142,7 @@ services:
142142
shm_size: 8G
143143
go:
144144
# This should match the version we are using on Cloud Run.
145-
image: golang:1.19
145+
image: golang:1.20rc3
146146
entrypoint: go
147147
environment:
148148
<<: *database-variables

internal/godoc/dochtml/internal/render/linkify.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -612,7 +612,9 @@ scan:
612612
line := file.Line(p) - 1 // current 0-indexed line number
613613
offset := file.Offset(p) // current offset into source file
614614
tokType := codeType // current token type (assume source code)
615-
615+
if lastOffset > offset {
616+
continue
617+
}
616618
// Add traversed bytes from src to the appropriate line.
617619
prevLines := strings.SplitAfter(string(src[lastOffset:offset]), "\n")
618620
for i, ln := range prevLines {

internal/middleware/experiment_test.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,8 @@ func TestSetAndLoadExperiments(t *testing.T) {
7777
}
7878

7979
func TestShouldSetExperiment(t *testing.T) {
80+
// Force the pre-go1.20 behavior of rand.Seed
81+
rand.Seed(1)
8082
ipv4Addr := func() string {
8183
a := make([]string, 4)
8284
for i := 0; i < 4; i++ {

0 commit comments

Comments
 (0)