Skip to content

Commit 4d14b96

Browse files
authored
Switch to Go 1.21 (hashicorp#234)
1 parent 0bdf670 commit 4d14b96

File tree

5 files changed

+9
-29
lines changed

5 files changed

+9
-29
lines changed

.github/workflows/main.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ jobs:
1616
- name: Set up go
1717
uses: actions/setup-go@fac708d6674e30b6ba41289acaab6d4b75aa0753 # v4.0.1
1818
with:
19-
go-version: 1.18
19+
go-version: 1.21
2020

2121
- name: Build
2222
run: go build -v ./...
@@ -35,7 +35,7 @@ jobs:
3535
- name: Set up go
3636
uses: actions/setup-go@fac708d6674e30b6ba41289acaab6d4b75aa0753 # v4.0.1
3737
with:
38-
go-version: 1.18
38+
go-version: 1.21
3939

4040
- name: Ensure the code has been properly regenerated with 'make regen'
4141
run: |

go.mod

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,19 @@
11
module github.com/hashicorp/vault-client-go
22

3-
go 1.18
3+
go 1.21
44

55
require (
66
github.com/hashicorp/go-cleanhttp v0.5.2
7-
github.com/hashicorp/go-multierror v1.1.1
87
github.com/hashicorp/go-retryablehttp v0.7.1
98
github.com/hashicorp/go-rootcerts v1.0.2
109
github.com/hashicorp/go-secure-stdlib/strutil v0.1.2
1110
github.com/stretchr/testify v1.8.0
12-
golang.org/x/exp v0.0.0-20230801115018-d63ba01acd4b
1311
golang.org/x/sys v0.4.0
1412
golang.org/x/time v0.0.0-20220922220347-f3bd1da661af
1513
)
1614

1715
require (
1816
github.com/davecgh/go-spew v1.1.1 // indirect
19-
github.com/hashicorp/errwrap v1.0.0 // indirect
2017
github.com/mitchellh/go-homedir v1.1.0 // indirect
2118
github.com/pmezard/go-difflib v1.0.0 // indirect
2219
github.com/ryanuber/go-glob v1.0.0 // indirect

go.sum

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,11 @@
11
github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
22
github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c=
33
github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
4-
github.com/hashicorp/errwrap v1.0.0 h1:hLrqtEDnRye3+sgx6z4qVLNuviH3MR5aQ0ykNJa/UYA=
5-
github.com/hashicorp/errwrap v1.0.0/go.mod h1:YH+1FKiLXxHSkmPseP+kNlulaMuP3n2brvKWEqk/Jc4=
64
github.com/hashicorp/go-cleanhttp v0.5.1/go.mod h1:JpRdi6/HCYpAwUzNwuwqhbovhLtngrth3wmdIIUrZ80=
75
github.com/hashicorp/go-cleanhttp v0.5.2 h1:035FKYIWjmULyFRBKPs8TBQoi0x6d9G4xc9neXJWAZQ=
86
github.com/hashicorp/go-cleanhttp v0.5.2/go.mod h1:kO/YDlP8L1346E6Sodw+PrpBSV4/SoxCXGY6BqNFT48=
97
github.com/hashicorp/go-hclog v0.9.2 h1:CG6TE5H9/JXsFWJCfoIVpKFIkFe6ysEuHirp4DxCsHI=
108
github.com/hashicorp/go-hclog v0.9.2/go.mod h1:5CU+agLiy3J7N7QjHK5d05KxGsuXiQLrjA0H7acj2lQ=
11-
github.com/hashicorp/go-multierror v1.1.1 h1:H5DkEtf6CXdFp0N0Em5UCwQpXMWke8IA0+lD48awMYo=
12-
github.com/hashicorp/go-multierror v1.1.1/go.mod h1:iw975J/qwKPdAO1clOe2L8331t/9/fmwbPZ6JB6eMoM=
139
github.com/hashicorp/go-retryablehttp v0.7.1 h1:sUiuQAnLlbvmExtFQs72iFW/HXeUn8Z1aJLQ4LJJbTQ=
1410
github.com/hashicorp/go-retryablehttp v0.7.1/go.mod h1:vAew36LZh98gCBJNLH42IQ1ER/9wtLZZ8meHqQvEYWY=
1511
github.com/hashicorp/go-rootcerts v1.0.2 h1:jzhAVGtqPKbwpyCPELlgNWhE1znq+qwJtW5Oi2viEzc=
@@ -28,8 +24,6 @@ github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXf
2824
github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
2925
github.com/stretchr/testify v1.8.0 h1:pSgiaMZlXftHpm5L7V1+rVB+AZJydKsMxsQBIJw4PKk=
3026
github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU=
31-
golang.org/x/exp v0.0.0-20230801115018-d63ba01acd4b h1:r+vk0EmXNmekl0S0BascoeeoHk/L7wmaW2QF90K+kYI=
32-
golang.org/x/exp v0.0.0-20230801115018-d63ba01acd4b/go.mod h1:FXUEEKJgO7OQYeo8N01OfiKP8RXMtf6e8aTskBGqWdc=
3327
golang.org/x/sys v0.4.0 h1:Zr2JFtRQNX3BCZ8YtxRE9hNJYC8J6I1MVbMg6owUp18=
3428
golang.org/x/sys v0.4.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
3529
golang.org/x/time v0.0.0-20220922220347-f3bd1da661af h1:Yx9k8YCG3dvF87UAn2tu2HQLf2dt/eR1bXxpLMWeH+Y=

request_modifiers.go

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,12 @@ package vault
55

66
import (
77
"fmt"
8+
"maps"
89
"net/http"
910
"net/url"
1011
"strings"
1112
"time"
1213
"unicode"
13-
14-
"github.com/hashicorp/go-multierror"
15-
"golang.org/x/exp/maps"
1614
)
1715

1816
type (
@@ -310,17 +308,14 @@ func validateNamespace(namespace string) error {
310308
return nil
311309
}
312310

313-
func validateCustomHeaders(headers http.Header) (errs error) {
311+
func validateCustomHeaders(headers http.Header) error {
314312
for key := range headers {
315313
if strings.HasPrefix(strings.ToLower(key), "x-vault-") {
316-
errs = multierror.Append(
317-
errs,
318-
fmt.Errorf("custom header key %q is not allowed: 'X-Vault-' prefix is for internal use only", key),
319-
)
314+
return fmt.Errorf("custom header key %q is not allowed: 'X-Vault-' prefix is for internal use only", key)
320315
}
321316
}
322317

323-
return errs
318+
return nil
324319
}
325320

326321
// printable returns true if the given string has no non-printable characters

request_option.go

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,6 @@ import (
88
"net/url"
99
"strings"
1010
"time"
11-
12-
"github.com/hashicorp/go-multierror"
1311
)
1412

1513
// RequestOption is a functional parameter used to modify a request
@@ -143,18 +141,14 @@ func WithReplicationForwardingMode(mode ReplicationForwardingMode) RequestOption
143141
}
144142

145143
// requestOptionsToRequestModifiers constructs `requestModifiers` propagating the errors, if any
146-
func requestOptionsToRequestModifiers(options []RequestOption) (_ requestModifiers, errs error) {
144+
func requestOptionsToRequestModifiers(options []RequestOption) (requestModifiers, error) {
147145
var modifiers requestModifiers
148146

149147
for _, option := range options {
150148
if err := option(&modifiers); err != nil {
151-
errs = multierror.Append(errs, err)
149+
return requestModifiers{}, err
152150
}
153151
}
154152

155-
if errs != nil {
156-
return requestModifiers{}, errs
157-
}
158-
159153
return modifiers, nil
160154
}

0 commit comments

Comments
 (0)