Skip to content

Commit f9ea4ab

Browse files
techknowlogicksilverwind6543zeripathMrGussio
authored
Bump to build with go1.18 (#19120 et al) (#19127)
Backport #19120 Backport #19099 Backport #18874 Backport #18420 Backport #19128 Backport #18270 Bump to build with go1.18 Co-authored-by: techknowlogick <[email protected]> Signed-off-by: Andrew Thornton <[email protected]> Co-authored-by: silverwind <[email protected]> Co-authored-by: 6543 <[email protected]> Co-authored-by: zeripath <[email protected]> Co-authored-by: Jelle Hulter <[email protected]>
1 parent e6d46ee commit f9ea4ab

File tree

16 files changed

+1053
-338
lines changed

16 files changed

+1053
-338
lines changed

.drone.yml

+24-15
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ steps:
2525
- make deps-frontend
2626

2727
- name: deps-backend
28-
image: golang:1.17
28+
image: golang:1.18
2929
pull: always
3030
commands:
3131
- make deps-backend
@@ -49,18 +49,24 @@ steps:
4949
GOSUMDB: sum.golang.org
5050
TAGS: bindata sqlite sqlite_unlock_notify
5151
depends_on: [deps-backend]
52+
volumes:
53+
- name: deps
54+
path: /go
5255

5356
- name: lint-backend-windows
5457
image: gitea/test_env:linux-amd64 # https://gitea.com/gitea/test-env
5558
commands:
56-
- make golangci-lint vet
59+
- make golangci-lint-windows vet
5760
environment:
5861
GOPROXY: https://goproxy.cn # proxy.golang.org is blocked in China, this proxy is not
5962
GOSUMDB: sum.golang.org
6063
TAGS: bindata sqlite sqlite_unlock_notify
6164
GOOS: windows
6265
GOARCH: amd64
6366
depends_on: [deps-backend]
67+
volumes:
68+
- name: deps
69+
path: /go
6470

6571
- name: lint-backend-gogit
6672
image: gitea/test_env:linux-amd64 # https://gitea.com/gitea/test-env
@@ -71,6 +77,9 @@ steps:
7177
GOSUMDB: sum.golang.org
7278
TAGS: bindata gogit sqlite sqlite_unlock_notify
7379
depends_on: [deps-backend]
80+
volumes:
81+
- name: deps
82+
path: /go
7483

7584
- name: checks-frontend
7685
image: node:16
@@ -79,7 +88,7 @@ steps:
7988
depends_on: [deps-frontend]
8089

8190
- name: checks-backend
82-
image: golang:1.17
91+
image: golang:1.18
8392
commands:
8493
- make checks-backend
8594
depends_on: [deps-backend]
@@ -100,7 +109,7 @@ steps:
100109
depends_on: [test-frontend]
101110

102111
- name: build-backend-no-gcc
103-
image: golang:1.16 # this step is kept as the lowest version of golang that we support
112+
image: golang:1.17 # this step is kept as the lowest version of golang that we support
104113
pull: always
105114
environment:
106115
GO111MODULE: on
@@ -113,7 +122,7 @@ steps:
113122
path: /go
114123

115124
- name: build-backend-arm64
116-
image: golang:1.17
125+
image: golang:1.18
117126
environment:
118127
GO111MODULE: on
119128
GOPROXY: https://goproxy.cn
@@ -129,7 +138,7 @@ steps:
129138
path: /go
130139

131140
- name: build-backend-windows
132-
image: golang:1.17
141+
image: golang:1.18
133142
environment:
134143
GO111MODULE: on
135144
GOPROXY: https://goproxy.cn
@@ -144,7 +153,7 @@ steps:
144153
path: /go
145154

146155
- name: build-backend-386
147-
image: golang:1.17
156+
image: golang:1.18
148157
environment:
149158
GO111MODULE: on
150159
GOPROXY: https://goproxy.cn
@@ -233,7 +242,7 @@ steps:
233242
- pull_request
234243

235244
- name: deps-backend
236-
image: golang:1.17
245+
image: golang:1.18
237246
pull: always
238247
commands:
239248
- make deps-backend
@@ -350,7 +359,7 @@ steps:
350359
path: /go
351360

352361
- name: generate-coverage
353-
image: golang:1.17
362+
image: golang:1.18
354363
commands:
355364
- make coverage
356365
environment:
@@ -425,7 +434,7 @@ steps:
425434
- pull_request
426435

427436
- name: deps-backend
428-
image: golang:1.17
437+
image: golang:1.18
429438
pull: always
430439
commands:
431440
- make deps-backend
@@ -567,7 +576,7 @@ trigger:
567576

568577
steps:
569578
- name: download
570-
image: golang:1.17
579+
image: golang:1.18
571580
pull: always
572581
commands:
573582
- timeout -s ABRT 40m make generate-license generate-gitignore
@@ -628,7 +637,7 @@ steps:
628637
- make deps-frontend
629638

630639
- name: deps-backend
631-
image: golang:1.17
640+
image: golang:1.18
632641
pull: always
633642
commands:
634643
- make deps-backend
@@ -637,7 +646,7 @@ steps:
637646
path: /go
638647

639648
- name: static
640-
image: techknowlogick/xgo:go-1.17.x
649+
image: techknowlogick/xgo:go-1.18.x
641650
pull: always
642651
commands:
643652
- curl -sL https://deb.nodesource.com/setup_16.x | bash - && apt-get install -y nodejs
@@ -746,7 +755,7 @@ steps:
746755
- make deps-frontend
747756

748757
- name: deps-backend
749-
image: golang:1.17
758+
image: golang:1.18
750759
pull: always
751760
commands:
752761
- make deps-backend
@@ -755,7 +764,7 @@ steps:
755764
path: /go
756765

757766
- name: static
758-
image: techknowlogick/xgo:go-1.17.x
767+
image: techknowlogick/xgo:go-1.18.x
759768
pull: always
760769
commands:
761770
- curl -sL https://deb.nodesource.com/setup_16.x | bash - && apt-get install -y nodejs

.golangci.yml

+13-2
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ linters:
1313
#- gocyclo # The cyclomatic complexety of a lot of functions is too high, we should refactor those another time.
1414
- gofmt
1515
- misspell
16-
- gocritic
16+
#- gocritic # TODO: disabled until fixed with go 1.18
1717
- bidichk
1818
- ineffassign
1919
- revive
@@ -22,7 +22,7 @@ linters:
2222
fast: false
2323

2424
run:
25-
timeout: 3m
25+
timeout: 10m
2626
skip-dirs:
2727
- node_modules
2828
- public
@@ -61,6 +61,9 @@ linters-settings:
6161
- name: errorf
6262
- name: duplicated-imports
6363
- name: modifies-value-receiver
64+
gofumpt:
65+
extra-rules: true
66+
lang-version: 1.18
6467

6568
issues:
6669
exclude-rules:
@@ -148,3 +151,11 @@ issues:
148151
- path: models/user/openid.go
149152
linters:
150153
- golint
154+
- linters: staticcheck
155+
text: "strings.Title is deprecated: The rule Title uses for word boundaries does not handle Unicode punctuation properly. Use golang.org/x/text/cases instead."
156+
- linters: staticcheck
157+
text: "util.FindClosure is deprecated: This function can not handle newlines. Many elements can be existed over multiple lines(e.g. link labels). Use text.Reader.FindClosure."
158+
- linters: staticcheck
159+
text: "gossh.SigAlgoRSASHA2256 is deprecated: use KeyAlgoRSASHA256."
160+
- linters: staticcheck
161+
text: "gossh.SigAlgoRSASHA2512 is deprecated: use KeyAlgoRSASHA512."

Dockerfile

+2-4
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
1-
2-
###################################
3-
#Build stage - temporarily using techknowlogick image until we upgrade to latest official alpine/go image
4-
FROM techknowlogick/go:1.17-alpine3.13 AS build-env
1+
#Build stage
2+
FROM golang:1.18-alpine3.15 AS build-env
53

64
ARG GOPROXY
75
ENV GOPROXY ${GOPROXY:-direct}

Dockerfile.rootless

+2-4
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
1-
2-
###################################
3-
#Build stage - temporarily using techknowlogick image until we upgrade to latest official alpine/go image
4-
FROM techknowlogick/go:1.17-alpine3.13 AS build-env
1+
#Build stage
2+
FROM golang:1.18-alpine3.15 AS build-env
53

64
ARG GOPROXY
75
ENV GOPROXY ${GOPROXY:-direct}

0 commit comments

Comments
 (0)