Skip to content

Commit d704fcc

Browse files
renovate[bot]tobiogigerdo
authored
chore(deps): update module go to 1.19 (#580)
* chore(deps): update module go to 1.19 * Fix 1.19 build * Update go.mod/go.sum/NOTICE Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> Co-authored-by: Toby Brain <toby.brain@elastic.co> Co-authored-by: Dominik Giger <dominik.giger@elastic.co>
1 parent efe9b87 commit d704fcc

29 files changed

+717
-749
lines changed

.github/workflows/go.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ jobs:
1010
- name: Set up Go
1111
uses: actions/setup-go@v3
1212
with:
13-
go-version: 1.17
13+
go-version: 1.19
1414
id: go
1515

1616
- name: Check out code into the Go module directory
@@ -31,7 +31,7 @@ jobs:
3131
- name: Linters
3232
run: make lint
3333
id: lint
34-
34+
3535
- name: Check that docs are up to date
3636
run: make docs
3737
id: docs

.golangci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ linters-settings:
1717

1818
gofmt:
1919
simplify: true
20-
20+
2121
golint:
2222
min-confidence: 0
2323

NOTICE

Lines changed: 51 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -6,15 +6,56 @@ third-party software developed by the licenses listed below.
66

77
=========================================================================
88

9-
github.com/elastic/cloud-sdk-go Apache-2.0
10-
github.com/go-openapi/runtime Apache-2.0
11-
github.com/go-openapi/strfmt Apache-2.0
12-
github.com/spf13/cobra Apache-2.0
13-
github.com/pkg/errors BSD-2-Clause
14-
github.com/spf13/pflag BSD-3-Clause
15-
golang.org/x/term BSD-3-Clause
16-
github.com/asaskevich/govalidator MIT
17-
github.com/spf13/viper MIT
18-
github.com/stretchr/testify MIT
9+
github.com/davecgh/go-spew 0BSD
10+
github.com/elastic/cloud-sdk-go Apache-2.0
11+
github.com/go-openapi/analysis Apache-2.0
12+
github.com/go-openapi/errors Apache-2.0
13+
github.com/go-openapi/jsonpointer Apache-2.0
14+
github.com/go-openapi/jsonreference Apache-2.0
15+
github.com/go-openapi/loads Apache-2.0
16+
github.com/go-openapi/runtime Apache-2.0
17+
github.com/go-openapi/spec Apache-2.0
18+
github.com/go-openapi/strfmt Apache-2.0
19+
github.com/go-openapi/swag Apache-2.0
20+
github.com/go-openapi/validate Apache-2.0
21+
github.com/inconshreveable/mousetrap Apache-2.0
22+
github.com/oklog/ulid Apache-2.0
23+
github.com/opentracing/opentracing-go Apache-2.0
24+
github.com/pelletier/go-toml Apache-2.0
25+
github.com/spf13/afero Apache-2.0
26+
github.com/spf13/cobra Apache-2.0
27+
go.mongodb.org/mongo-driver Apache-2.0
28+
gopkg.in/ini.v1 Apache-2.0
29+
gopkg.in/yaml.v2 Apache-2.0
30+
gopkg.in/yaml.v3 Apache-2.0
31+
github.com/magiconair/properties BSD-2-Clause
32+
github.com/pkg/errors BSD-2-Clause
33+
github.com/russross/blackfriday/v2 BSD-2-Clause
34+
github.com/puerkitobio/purell BSD-3-Clause
35+
github.com/puerkitobio/urlesc BSD-3-Clause
36+
github.com/fsnotify/fsnotify BSD-3-Clause
37+
github.com/pmezard/go-difflib BSD-3-Clause
38+
github.com/spf13/pflag BSD-3-Clause
39+
golang.org/x/net BSD-3-Clause
40+
golang.org/x/sys BSD-3-Clause
41+
golang.org/x/term BSD-3-Clause
42+
golang.org/x/text BSD-3-Clause
43+
github.com/asaskevich/govalidator MIT
44+
github.com/blang/semver/v4 MIT
45+
github.com/cpuguy83/go-md2man/v2 MIT
46+
github.com/go-stack/stack MIT
47+
github.com/josharian/intern MIT
48+
github.com/mailru/easyjson MIT
49+
github.com/mitchellh/mapstructure MIT
50+
github.com/pelletier/go-toml/v2 MIT
51+
github.com/spf13/cast MIT
52+
github.com/spf13/jwalterweatherman MIT
53+
github.com/spf13/viper MIT
54+
github.com/stretchr/testify MIT
55+
github.com/subosito/gotenv MIT
56+
github.com/hashicorp/errwrap MPL-2.0
57+
github.com/hashicorp/go-multierror MPL-2.0
58+
github.com/hashicorp/hcl MPL-2.0
59+
github.com/ghodss/yaml no license file was found
1960

2061
=========================================================================

cmd/deployment/create_test.go

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,10 @@
1818
package cmddeployment
1919

2020
import (
21+
_ "embed"
2122
"encoding/json"
2223
"errors"
2324
"fmt"
24-
"io/ioutil"
2525
"net/http"
2626
"net/url"
2727
"testing"
@@ -36,6 +36,9 @@ import (
3636
"github.com/elastic/ecctl/cmd/util/testutils"
3737
)
3838

39+
//go:embed "testdata/template-aws-io-optimized-v2.json"
40+
var awsIoOptimisedTemplate []byte
41+
3942
func Test_createCmd(t *testing.T) {
4043
var deploymentID = ec.RandomResourceID()
4144
var esID = ec.RandomResourceID()
@@ -247,11 +250,6 @@ Deployment [%s] - [Apm][%s]: running step "waiting-for-some-step" (Plan duration
247250
})),
248251
}
249252

250-
awsIoOpt, err := ioutil.ReadFile("./testdata/template-aws-io-optimized-v2.json")
251-
if err != nil {
252-
t.Fatal(err)
253-
}
254-
255253
tests := []struct {
256254
name string
257255
args testutils.Args
@@ -287,7 +285,7 @@ Deployment [%s] - [Apm][%s]: running step "waiting-for-some-step" (Plan duration
287285
{
288286
Response: http.Response{
289287
StatusCode: 200,
290-
Body: mock.NewByteBody(awsIoOpt),
288+
Body: mock.NewByteBody(awsIoOptimisedTemplate),
291289
},
292290
Assert: &mock.RequestAssertion{
293291
Method: "GET",
@@ -338,7 +336,7 @@ Deployment [%s] - [Apm][%s]: running step "waiting-for-some-step" (Plan duration
338336
{
339337
Response: http.Response{
340338
StatusCode: 200,
341-
Body: mock.NewByteBody(awsIoOpt),
339+
Body: mock.NewByteBody(awsIoOptimisedTemplate),
342340
},
343341
Assert: &mock.RequestAssertion{
344342
Method: "GET",

cmd/deployment/elasticsearch/keystore/show_test.go

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,8 @@
1818
package cmdeskeystore
1919

2020
import (
21+
_ "embed"
2122
"encoding/json"
22-
"io/ioutil"
2323
"net/url"
2424
"testing"
2525

@@ -32,6 +32,9 @@ import (
3232
"github.com/elastic/ecctl/pkg/util"
3333
)
3434

35+
//go:embed "testdata/show.json"
36+
var showRawResp []byte
37+
3538
func Test_showCmd(t *testing.T) {
3639
var reqAssertion = &mock.RequestAssertion{
3740
Header: api.DefaultReadMockHeaders,
@@ -40,11 +43,6 @@ func Test_showCmd(t *testing.T) {
4043
Host: api.DefaultMockHost,
4144
}
4245

43-
showRawResp, err := ioutil.ReadFile("./testdata/show.json")
44-
if err != nil {
45-
t.Fatal(err)
46-
}
47-
4846
var succeedResp = new(models.KeystoreContents)
4947
if err := succeedResp.UnmarshalBinary(showRawResp); err != nil {
5048
t.Fatal(err)

cmd/deployment/elasticsearch/keystore/update_test.go

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,8 @@
1818
package cmdeskeystore
1919

2020
import (
21+
_ "embed"
2122
"encoding/json"
22-
"io/ioutil"
2323
"net/url"
2424
"testing"
2525

@@ -32,12 +32,10 @@ import (
3232
"github.com/elastic/ecctl/pkg/util"
3333
)
3434

35-
func Test_updateCmd(t *testing.T) {
36-
updateRawResp, err := ioutil.ReadFile("./testdata/update.json")
37-
if err != nil {
38-
t.Fatal(err)
39-
}
35+
//go:embed "testdata/update.json"
36+
var updateRawResp []byte
4037

38+
func Test_updateCmd(t *testing.T) {
4139
var succeedResp = new(models.KeystoreContents)
4240
if err := succeedResp.UnmarshalBinary(updateRawResp); err != nil {
4341
t.Fatal(err)

cmd/deployment/extension/create_test.go

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,8 @@
1818
package cmddeploymentextension
1919

2020
import (
21+
_ "embed"
2122
"encoding/json"
22-
"io/ioutil"
2323
"testing"
2424

2525
"github.com/elastic/cloud-sdk-go/pkg/api"
@@ -29,12 +29,10 @@ import (
2929
"github.com/elastic/ecctl/cmd/util/testutils"
3030
)
3131

32-
func Test_createCmd(t *testing.T) {
33-
createRawResp, err := ioutil.ReadFile("./testdata/create.json")
34-
if err != nil {
35-
t.Fatal(err)
36-
}
32+
//go:embed "testdata/create.json"
33+
var createRawResp []byte
3734

35+
func Test_createCmd(t *testing.T) {
3836
var succeedResp = new(models.Extension)
3937
if err := succeedResp.UnmarshalBinary(createRawResp); err != nil {
4038
t.Fatal(err)

cmd/deployment/extension/list_test.go

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,8 @@
1818
package cmddeploymentextension
1919

2020
import (
21+
_ "embed"
2122
"encoding/json"
22-
"io/ioutil"
2323
"testing"
2424

2525
"github.com/elastic/cloud-sdk-go/pkg/api"
@@ -29,12 +29,10 @@ import (
2929
"github.com/elastic/ecctl/cmd/util/testutils"
3030
)
3131

32-
func Test_listCmd(t *testing.T) {
33-
listRawResp, err := ioutil.ReadFile("./testdata/list.json")
34-
if err != nil {
35-
t.Fatal(err)
36-
}
32+
//go:embed "testdata/list.json"
33+
var listRawResp []byte
3734

35+
func Test_listCmd(t *testing.T) {
3836
var succeedResp = new(models.Extensions)
3937
if err := succeedResp.UnmarshalBinary(listRawResp); err != nil {
4038
t.Fatal(err)

cmd/deployment/extension/show_test.go

Lines changed: 7 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,8 @@
1818
package cmddeploymentextension
1919

2020
import (
21+
_ "embed"
2122
"encoding/json"
22-
"io/ioutil"
2323
"net/url"
2424
"testing"
2525

@@ -30,12 +30,13 @@ import (
3030
"github.com/elastic/ecctl/cmd/util/testutils"
3131
)
3232

33-
func Test_showCmd(t *testing.T) {
34-
showRawResp, err := ioutil.ReadFile("./testdata/show.json")
35-
if err != nil {
36-
t.Fatal(err)
37-
}
33+
//go:embed "testdata/show.json"
34+
var showRawResp []byte
35+
36+
//go:embed "testdata/show-dep.json"
37+
var showDepRawResp []byte
3838

39+
func Test_showCmd(t *testing.T) {
3940
var succeedResp = new(models.Extension)
4041
if err := succeedResp.UnmarshalBinary(showRawResp); err != nil {
4142
t.Fatal(err)
@@ -46,11 +47,6 @@ func Test_showCmd(t *testing.T) {
4647
t.Fatal(err)
4748
}
4849

49-
showDepRawResp, err := ioutil.ReadFile("./testdata/show-dep.json")
50-
if err != nil {
51-
t.Fatal(err)
52-
}
53-
5450
var succeedDepResp = new(models.Extension)
5551
if err := succeedDepResp.UnmarshalBinary(showDepRawResp); err != nil {
5652
t.Fatal(err)

cmd/deployment/extension/update_test.go

Lines changed: 7 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,8 @@
1818
package cmddeploymentextension
1919

2020
import (
21+
_ "embed"
2122
"encoding/json"
22-
"io/ioutil"
2323
"net/url"
2424
"testing"
2525

@@ -30,12 +30,13 @@ import (
3030
"github.com/elastic/ecctl/cmd/util/testutils"
3131
)
3232

33-
func Test_updateCmd(t *testing.T) {
34-
updatePayloadRawResp, err := ioutil.ReadFile("./testdata/update-payload.json")
35-
if err != nil {
36-
t.Fatal(err)
37-
}
33+
//go:embed "testdata/update-payload.json"
34+
var updatePayloadRawResp []byte
35+
36+
//go:embed "testdata/update.json"
37+
var updateRawResp []byte
3838

39+
func Test_updateCmd(t *testing.T) {
3940
var succeedPayloadResp = new(models.UpdateExtensionRequest)
4041
if err := succeedPayloadResp.UnmarshalBinary(updatePayloadRawResp); err != nil {
4142
t.Fatal(err)
@@ -46,11 +47,6 @@ func Test_updateCmd(t *testing.T) {
4647
t.Fatal(err)
4748
}
4849

49-
updateRawResp, err := ioutil.ReadFile("./testdata/update.json")
50-
if err != nil {
51-
t.Fatal(err)
52-
}
53-
5450
var succeedResp = new(models.Extension)
5551
if err := succeedResp.UnmarshalBinary(updateRawResp); err != nil {
5652
t.Fatal(err)

0 commit comments

Comments
 (0)