Skip to content
This repository was archived by the owner on Jun 2, 2025. It is now read-only.

Commit 82ac6c6

Browse files
authored
Merge pull request #209 from open-cluster-management-io/update-go-18
update go to 1.18
2 parents 566f21d + 7c59069 commit 82ac6c6

39 files changed

+233
-646
lines changed

.github/workflows/go-postsubmit.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ on:
88

99
env:
1010
# Common versions
11-
GO_VERSION: '1.17'
11+
GO_VERSION: '1.18'
1212
GO_REQUIRED_MIN_VERSION: ''
1313
GOPATH: '/home/runner/work/multicloud-operators-subscription/multicloud-operators-subscription/go'
1414
defaults:

.github/workflows/go-presubmit.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ on:
88

99
env:
1010
# Common versions
11-
GO_VERSION: '1.17'
11+
GO_VERSION: '1.18'
1212
GO_REQUIRED_MIN_VERSION: ''
1313
GOPATH: '/home/runner/work/multicloud-operators-subscription/multicloud-operators-subscription/go'
1414
defaults:

.github/workflows/go-release.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ on:
66
- 'v*.*.*'
77
env:
88
# Common versions
9-
GO_VERSION: '1.17'
9+
GO_VERSION: '1.18'
1010
GO_REQUIRED_MIN_VERSION: ''
1111
GOPATH: '/home/runner/work/multicloud-operators-subscription/multicloud-operators-subscription/go'
1212
GITHUB_REF: ${{ github.ref }}

build/Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM registry.ci.openshift.org/stolostron/builder:go1.17-linux AS plugin-builder
1+
FROM registry.ci.openshift.org/stolostron/builder:go1.18-linux AS plugin-builder
22
ENV POLICY_GENERATOR_TAG=v1.8.0
33

44
WORKDIR /policy-generator

build/Dockerfile.prow

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM registry.ci.openshift.org/stolostron/builder:go1.17-linux AS builder
1+
FROM registry.ci.openshift.org/stolostron/builder:go1.18-linux AS builder
22
ENV POLICY_GENERATOR_TAG=v1.8.0
33

44
WORKDIR /go/src/github.com/stolostron/multicluster-operators-subscription

build/run-code-lint.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ gem install mdl
3737
gem install awesome_bot
3838

3939
# Install golangci-lint
40-
curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b "$(go env GOPATH)"/bin v1.28.3
40+
curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b "$(go env GOPATH)"/bin v1.46.2
4141

4242
# Start lint task
4343
make -f Makefile.prow lint-all

cmd/appsubsummary/exec/manager.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,9 +30,9 @@ import (
3030

3131
// Change below variables to serve metrics on different host or port.
3232
var (
33-
metricsHost = "0.0.0.0"
34-
metricsPort int = 8391
35-
operatorMetricsPort int = 8691
33+
metricsHost = "0.0.0.0"
34+
metricsPort = 8391
35+
operatorMetricsPort = 8691
3636
)
3737

3838
// RunManager starts the actual manager.

cmd/manager/exec/manager.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -48,9 +48,9 @@ import (
4848

4949
// Change below variables to serve metrics on different host or port.
5050
var (
51-
metricsHost = "0.0.0.0"
52-
metricsPort int = 8381
53-
operatorMetricsPort int = 8684
51+
metricsHost = "0.0.0.0"
52+
metricsPort = 8381
53+
operatorMetricsPort = 8684
5454
)
5555

5656
const (

cmd/placementrule/exec/manager.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,9 +31,9 @@ import (
3131

3232
// Change below variables to serve metrics on different host or port.
3333
var (
34-
metricsHost = "0.0.0.0"
35-
metricsPort int = 8383
36-
operatorMetricsPort int = 8686
34+
metricsHost = "0.0.0.0"
35+
metricsPort = 8383
36+
operatorMetricsPort = 8686
3737
)
3838

3939
// RunManager starts the actual manager

common/config/.golangci.yml

Lines changed: 45 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
11
service:
22
# When updating this, also update the version stored in docker/build-tools/Dockerfile in the multicloudlab/tools repo.
3-
golangci-lint-version: 1.28.x # use the fixed version to not introduce new linters unexpectedly
3+
golangci-lint-version: 1.46.x # use the fixed version to not introduce new linters unexpectedly
44
run:
55
# timeout for analysis, e.g. 30s, 5m, default is 1m
66
deadline: 20m
77
timeout: 20m
8+
go: '1.17'
89

910
# which dirs to skip: they won't be analyzed;
1011
# can use regexp here: generated.*, regexp is applied on full path;
@@ -29,31 +30,56 @@ run:
2930
linters:
3031
enable-all: true
3132
disable:
32-
- exhaustive
33-
- maligned
33+
- bodyclose
34+
- contextcheck
35+
- cyclop
3436
- depguard
3537
- dupl
38+
- forbidigo
39+
- funlen
40+
- errchkjson
41+
- exhaustive
42+
- exhaustruct
43+
- exhaustivestruct
44+
- forcetypeassert
45+
- gci
3646
- gochecknoglobals
3747
- gochecknoinits
3848
- goconst
49+
- gocritic
3950
- gocyclo
51+
- godot
52+
- goerr113
53+
- gofumpt
54+
- golint
55+
- gomnd
56+
- gomoddirectives
4057
- gosec
58+
- ifshort
59+
- ineffassign
60+
- interfacer
61+
- ireturn
62+
- maintidx
63+
- maligned
4164
- nakedret
65+
- nestif
66+
- nilerr
67+
- nilnil
68+
- nlreturn
69+
- noctx
70+
- nonamedreturns
71+
- paralleltest
4272
- prealloc
73+
- predeclared
74+
- staticcheck
4375
- scopelint
44-
- funlen
45-
- bodyclose
46-
76+
- tagliatelle
77+
- tenv
4778
- testpackage
48-
- stylecheck
49-
- noctx
50-
- gomnd
51-
- goerr113
52-
- godot
53-
- gofumpt
54-
- nestif
55-
- ineffassign
56-
- unused
79+
- thelper
80+
- varnamelen
81+
- wastedassign
82+
- wrapcheck
5783
fast: false
5884

5985
linters-settings:
@@ -65,6 +91,10 @@ linters-settings:
6591
# report about assignment of errors to blank identifier: `num, _ := strconv.Atoi(numStr)`;
6692
# default is false: such cases aren't reported by default.
6793
check-blank: false
94+
nolintlint:
95+
# Disable to ensure that all nolint directives actually have an effect.
96+
# Default: false
97+
allow-unused: true
6898
govet:
6999
# report about shadowed variables
70100
check-shadowing: false

0 commit comments

Comments
 (0)