Skip to content

Commit 24dd8ee

Browse files
ethan256张远良
andauthored
upgrade to go1.18 (#77)
Co-authored-by: 张远良 <zhangyuanliang@shouqianba.com>
1 parent 1e522c3 commit 24dd8ee

16 files changed

Lines changed: 146 additions & 67 deletions

File tree

.github/workflows/build.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,10 +29,10 @@ jobs:
2929
name: Build
3030
runs-on: ubuntu-latest
3131
steps:
32-
- name: Set up Go 1.16
32+
- name: Set up Go 1.18
3333
uses: actions/setup-go@v2
3434
with:
35-
go-version: 1.16
35+
go-version: 1.18
3636
id: go
3737

3838
- name: Check out code into the Go module directory

.golangci.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818

1919
run:
2020
tests: false
21+
go: "1.18"
2122
skip-dirs:
2223
- third-party
2324

@@ -96,7 +97,6 @@ linters-settings:
9697

9798
linters:
9899
enable:
99-
- bodyclose
100100
- deadcode
101101
- depguard
102102
- dogsled
@@ -117,14 +117,14 @@ linters:
117117
- misspell
118118
- nakedret
119119
- staticcheck
120-
- structcheck
121120
- stylecheck
122121
- typecheck
123122
- unconvert
124-
- unparam
125123
- unused
126124
- varcheck
127125
- whitespace
126+
disable:
127+
- structcheck
128128

129129
service:
130130
golangci-lint-version: 1.20.x

Dockerfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,15 +16,15 @@
1616
# under the License.
1717
#
1818

19-
FROM golang:1.16 AS build
19+
FROM golang:1.18 AS build
2020

2121
WORKDIR /e2e
2222

2323
COPY . .
2424

2525
RUN make linux
2626

27-
FROM golang:1.16 AS bin
27+
FROM golang:1.18 AS bin
2828

2929
COPY --from=build /e2e/bin/linux/e2e /usr/local/bin/e2e
3030

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ all: clean lint test build
4040

4141
.PHONY: lint
4242
lint:
43-
$(GO_LINT) version || curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $(GO_PATH)/bin -d "v1.42.1"
43+
$(GO_LINT) version || curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $(GO_PATH)/bin -d "v1.46.2"
4444
$(GO_LINT) run -v --timeout 5m ./...
4545

4646
.PHONY: fix-lint

commands/verify/verify.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ func DoVerifyAccordingConfig() error {
121121
}
122122

123123
// TODO remove this in 2.0.0
124-
func parseInterval(retryInterval interface{}) (time.Duration, error) {
124+
func parseInterval(retryInterval any) (time.Duration, error) {
125125
var interval time.Duration
126126
var err error
127127
switch itv := retryInterval.(type) {

commands/verify/verify_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ import (
2424

2525
func Test_parseInterval(t *testing.T) {
2626
type args struct {
27-
retryInterval interface{}
27+
retryInterval any
2828
}
2929
tests := []struct {
3030
name string

go.mod

Lines changed: 87 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,106 @@
11
module github.com/apache/skywalking-infra-e2e
22

3-
go 1.16
3+
go 1.18
44

55
require (
6-
github.com/BurntSushi/toml v0.4.1 // indirect
76
github.com/docker/docker v20.10.7+incompatible
87
github.com/docker/go-connections v0.4.0
9-
github.com/evanphx/json-patch/v5 v5.6.0 // indirect
108
github.com/google/go-cmp v0.5.5
11-
github.com/gorilla/mux v1.8.0 // indirect
12-
github.com/mattn/go-isatty v0.0.14 // indirect
13-
github.com/morikuni/aec v1.0.0 // indirect
14-
github.com/pelletier/go-toml v1.9.4 // indirect
159
github.com/sirupsen/logrus v1.7.0
1610
github.com/spf13/cobra v1.2.1
1711
github.com/testcontainers/testcontainers-go v0.11.1
18-
golang.org/x/sys v0.0.0-20211025112917-711f33c9992c // indirect
1912
gopkg.in/yaml.v2 v2.4.0
2013
k8s.io/api v0.22.2
2114
k8s.io/apimachinery v0.22.2
2215
k8s.io/cli-runtime v0.22.2
2316
k8s.io/client-go v0.22.2
2417
k8s.io/kubectl v0.22.2
2518
sigs.k8s.io/kind v0.11.1
19+
)
20+
21+
require (
22+
github.com/Azure/go-ansiterm v0.0.0-20210617225240-d185dfc1b5a1 // indirect
23+
github.com/BurntSushi/toml v0.4.1 // indirect
24+
github.com/MakeNowJust/heredoc v0.0.0-20170808103936-bb23615498cd // indirect
25+
github.com/Microsoft/go-winio v0.4.17-0.20210211115548-6eac466e5fa3 // indirect
26+
github.com/Microsoft/hcsshim v0.8.16 // indirect
27+
github.com/PuerkitoBio/purell v1.1.1 // indirect
28+
github.com/PuerkitoBio/urlesc v0.0.0-20170810143723-de5bf2ad4578 // indirect
29+
github.com/alessio/shellescape v1.4.1 // indirect
30+
github.com/cenkalti/backoff v2.2.1+incompatible // indirect
31+
github.com/chai2010/gettext-go v0.0.0-20160711120539-c6fed771bfd5 // indirect
32+
github.com/containerd/cgroups v0.0.0-20210114181951-8a68de567b68 // indirect
33+
github.com/containerd/containerd v1.5.0-beta.4 // indirect
34+
github.com/davecgh/go-spew v1.1.1 // indirect
35+
github.com/docker/distribution v2.7.1+incompatible // indirect
36+
github.com/docker/go-units v0.4.0 // indirect
37+
github.com/evanphx/json-patch v4.11.0+incompatible // indirect
38+
github.com/evanphx/json-patch/v5 v5.6.0 // indirect
39+
github.com/exponent-io/jsonpath v0.0.0-20151013193312-d6023ce2651d // indirect
40+
github.com/fatih/camelcase v1.0.0 // indirect
41+
github.com/fvbommel/sortorder v1.0.1 // indirect
42+
github.com/go-errors/errors v1.0.1 // indirect
43+
github.com/go-logr/logr v0.4.0 // indirect
44+
github.com/go-openapi/jsonpointer v0.19.5 // indirect
45+
github.com/go-openapi/jsonreference v0.19.5 // indirect
46+
github.com/go-openapi/swag v0.19.14 // indirect
47+
github.com/gogo/protobuf v1.3.2 // indirect
48+
github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da // indirect
49+
github.com/golang/protobuf v1.5.2 // indirect
50+
github.com/google/btree v1.0.1 // indirect
51+
github.com/google/gofuzz v1.1.0 // indirect
52+
github.com/google/shlex v0.0.0-20191202100458-e7afc7fbc510 // indirect
53+
github.com/google/uuid v1.2.0 // indirect
54+
github.com/googleapis/gnostic v0.5.5 // indirect
55+
github.com/gorilla/mux v1.8.0 // indirect
56+
github.com/gregjones/httpcache v0.0.0-20180305231024-9cad4c3443a7 // indirect
57+
github.com/imdario/mergo v0.3.11 // indirect
58+
github.com/inconshreveable/mousetrap v1.0.0 // indirect
59+
github.com/josharian/intern v1.0.0 // indirect
60+
github.com/json-iterator/go v1.1.11 // indirect
61+
github.com/liggitt/tabwriter v0.0.0-20181228230101-89fcab3d43de // indirect
62+
github.com/mailru/easyjson v0.7.6 // indirect
63+
github.com/mattn/go-isatty v0.0.14 // indirect
64+
github.com/mitchellh/go-wordwrap v1.0.0 // indirect
65+
github.com/moby/spdystream v0.2.0 // indirect
66+
github.com/moby/sys/mount v0.2.0 // indirect
67+
github.com/moby/sys/mountinfo v0.4.1 // indirect
68+
github.com/moby/term v0.0.0-20210610120745-9d4ed1856297 // indirect
69+
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect
70+
github.com/modern-go/reflect2 v1.0.1 // indirect
71+
github.com/monochromegane/go-gitignore v0.0.0-20200626010858-205db1a8cc00 // indirect
72+
github.com/morikuni/aec v1.0.0 // indirect
73+
github.com/opencontainers/go-digest v1.0.0 // indirect
74+
github.com/opencontainers/image-spec v1.0.1 // indirect
75+
github.com/opencontainers/runc v1.0.0-rc93 // indirect
76+
github.com/pelletier/go-toml v1.9.4 // indirect
77+
github.com/peterbourgon/diskv v2.0.1+incompatible // indirect
78+
github.com/pkg/errors v0.9.1 // indirect
79+
github.com/pmezard/go-difflib v1.0.0 // indirect
80+
github.com/russross/blackfriday v1.5.2 // indirect
81+
github.com/spf13/pflag v1.0.5 // indirect
82+
github.com/stretchr/testify v1.7.0 // indirect
83+
github.com/xlab/treeprint v0.0.0-20181112141820-a009c3971eca // indirect
84+
go.opencensus.io v0.23.0 // indirect
85+
go.starlark.net v0.0.0-20200306205701-8dd3e2ee1dd5 // indirect
86+
golang.org/x/net v0.0.0-20210520170846-37e1c6afe023 // indirect
87+
golang.org/x/oauth2 v0.0.0-20210402161424-2e8d93401602 // indirect
88+
golang.org/x/sys v0.0.0-20211025112917-711f33c9992c // indirect
89+
golang.org/x/term v0.0.0-20210220032956-6a3ed077a48d // indirect
90+
golang.org/x/text v0.3.6 // indirect
91+
golang.org/x/time v0.0.0-20210723032227-1f47c861a9ac // indirect
92+
google.golang.org/appengine v1.6.7 // indirect
93+
google.golang.org/genproto v0.0.0-20210602131652-f16073e35f0c // indirect
94+
google.golang.org/grpc v1.38.0 // indirect
95+
google.golang.org/protobuf v1.26.0 // indirect
96+
gopkg.in/inf.v0 v0.9.1 // indirect
97+
gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b // indirect
98+
k8s.io/component-base v0.22.2 // indirect
99+
k8s.io/klog/v2 v2.9.0 // indirect
100+
k8s.io/kube-openapi v0.0.0-20210421082810-95288971da7e // indirect
101+
k8s.io/utils v0.0.0-20210819203725-bdf08cb9a70a // indirect
102+
sigs.k8s.io/kustomize/api v0.8.11 // indirect
103+
sigs.k8s.io/kustomize/kyaml v0.11.0 // indirect
104+
sigs.k8s.io/structured-merge-diff/v4 v4.1.2 // indirect
26105
sigs.k8s.io/yaml v1.3.0 // indirect
27106
)

internal/components/setup/compose.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -246,15 +246,15 @@ func buildComposeServices(e2eConfig *config.E2EConfig, compose *testcontainers.L
246246
waitTimeout := e2eConfig.Setup.GetTimeout()
247247
services := make([]*ComposeService, 0)
248248
for service, content := range compose.Services {
249-
serviceConfig := content.(map[interface{}]interface{})
249+
serviceConfig := content.(map[any]any)
250250
ports := serviceConfig["ports"]
251251
serviceContext := &ComposeService{Name: service}
252252
services = append(services, serviceContext)
253253
if ports == nil {
254254
continue
255255
}
256256

257-
portList := ports.([]interface{})
257+
portList := ports.([]any)
258258
for inx := range portList {
259259
exportPort, err := getExpectPort(portList[inx])
260260
if err != nil {
@@ -273,7 +273,7 @@ func buildComposeServices(e2eConfig *config.E2EConfig, compose *testcontainers.L
273273
return services, nil
274274
}
275275

276-
func getExpectPort(portConfig interface{}) (int, error) {
276+
func getExpectPort(portConfig any) (int, error) {
277277
switch conf := portConfig.(type) {
278278
case int:
279279
return conf, nil

internal/components/verifier/funcs.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,14 +30,14 @@ import (
3030
// Use this to pass the functions into the template engine:
3131
// tpl := template.New("foo").Funcs(funcMap()))
3232
func funcMap() template.FuncMap {
33-
fm := make(map[string]interface{}, len(customFuncMap))
33+
fm := make(map[string]any, len(customFuncMap))
3434
for k, v := range customFuncMap {
3535
fm[k] = v
3636
}
3737
return template.FuncMap(fm)
3838
}
3939

40-
var customFuncMap = map[string]interface{}{
40+
var customFuncMap = map[string]any{
4141
// Basic:
4242
"notEmpty": notEmpty,
4343

internal/components/verifier/verifier.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ func (e *MismatchError) Error() string {
4545

4646
// Verify checks if the actual data match the expected template.
4747
func Verify(actualData, expectedTemplate string) error {
48-
var actual interface{}
48+
var actual any
4949
if err := yaml.Unmarshal([]byte(actualData), &actual); err != nil {
5050
return fmt.Errorf("failed to unmarshal actual data: %v", err)
5151
}
@@ -60,7 +60,7 @@ func Verify(actualData, expectedTemplate string) error {
6060
return fmt.Errorf("failed to execute template: %v", err)
6161
}
6262

63-
var expected interface{}
63+
var expected any
6464
if err := yaml.Unmarshal(b.Bytes(), &expected); err != nil {
6565
return fmt.Errorf("failed to unmarshal expected data: %v", err)
6666
}

0 commit comments

Comments
 (0)