Skip to content

Commit bf35dd0

Browse files
authored
allocator: Remove the last hashicorp/go-multierror (#306)
Removes the last unprefixed multierror and tidies the `go.sum` and re- generates the NOTICE file. Signed-off-by: Marc Lopez <marc5.12@outlook.com>
1 parent acd442f commit bf35dd0

File tree

4 files changed

+14
-24
lines changed

4 files changed

+14
-24
lines changed

NOTICE

Lines changed: 9 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -6,19 +6,14 @@ third-party software developed by the licenses listed below.
66

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

9-
github.com/davecgh/go-spew 0BSD
10-
github.com/elastic/cloud-sdk-go Apache-2.0
11-
github.com/go-openapi/runtime Apache-2.0
12-
github.com/go-openapi/strfmt Apache-2.0
13-
github.com/spf13/cobra Apache-2.0
14-
github.com/pkg/errors BSD-2-Clause
15-
github.com/pmezard/go-difflib BSD-3-Clause
16-
github.com/spf13/pflag BSD-3-Clause
17-
golang.org/x/crypto BSD-3-Clause
18-
github.com/asaskevich/govalidator MIT
19-
github.com/blang/semver MIT
20-
github.com/spf13/viper MIT
21-
github.com/hashicorp/go-multierror MPL-2.0
22-
github.com/ghodss/yaml no license file was found
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/crypto BSD-3-Clause
16+
github.com/asaskevich/govalidator MIT
17+
github.com/spf13/viper MIT
2318

2419
=========================================================================

cmd/platform/allocator/vacate.go

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,9 @@ import (
2424
"strconv"
2525

2626
"github.com/elastic/cloud-sdk-go/pkg/api/platformapi/allocatorapi"
27+
"github.com/elastic/cloud-sdk-go/pkg/multierror"
2728
sdkcmdutil "github.com/elastic/cloud-sdk-go/pkg/util/cmdutil"
2829
"github.com/elastic/cloud-sdk-go/pkg/util/ec"
29-
"github.com/hashicorp/go-multierror"
3030
"github.com/spf13/cobra"
3131

3232
cmdutil "github.com/elastic/ecctl/cmd/util"
@@ -138,7 +138,7 @@ var vacateAllocatorCmd = &cobra.Command{
138138

139139
setAllocatorMaintenance, _ := cmd.Flags().GetBool("maintenance")
140140

141-
var merr error
141+
var merr = multierror.NewPrefixed("failed setting allocator to maintenance mode")
142142
// Only sets the allocator to maintenance mode when the flag is specified
143143
if setAllocatorMaintenance {
144144
for _, id := range args {
@@ -147,13 +147,13 @@ var vacateAllocatorCmd = &cobra.Command{
147147
ID: id,
148148
}
149149
if err := allocatorapi.StartMaintenance(params); err != nil {
150-
merr = multierror.Append(merr, err)
150+
merr = merr.Append(err)
151151
}
152152
}
153153
}
154154

155-
if merr != nil {
156-
fmt.Fprint(ecctl.Get().Config.OutputDevice, merr)
155+
if err := merr.ErrorOrNil(); err != nil {
156+
fmt.Fprint(ecctl.Get().Config.OutputDevice, err.Error())
157157
}
158158

159159
maxRetries, pollFrequency := cmdutil.GetTrackSettings(cmd)

go.mod

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ require (
77
github.com/elastic/cloud-sdk-go v1.0.0-beta3.0.20200611025421-9b8340580ba3
88
github.com/go-openapi/runtime v0.19.15
99
github.com/go-openapi/strfmt v0.19.5
10-
github.com/hashicorp/go-multierror v1.0.0
1110
github.com/pkg/errors v0.9.1
1211
github.com/spf13/cobra v0.0.7
1312
github.com/spf13/pflag v1.0.5

go.sum

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -59,10 +59,6 @@ github.com/dgrijalva/jwt-go v3.2.0+incompatible/go.mod h1:E3ru+11k8xSBh+hMPgOLZm
5959
github.com/dgryski/go-sip13 v0.0.0-20181026042036-e10d5fee7954/go.mod h1:vAd38F8PWV+bWy6jNmig1y/TA+kYO4g3RSRF0IAv0no=
6060
github.com/docker/go-units v0.3.3/go.mod h1:fgPhTUdO+D/Jk86RDLlptpiXQzgHJF7gydDDbaIK4Dk=
6161
github.com/docker/go-units v0.4.0/go.mod h1:fgPhTUdO+D/Jk86RDLlptpiXQzgHJF7gydDDbaIK4Dk=
62-
github.com/elastic/cloud-sdk-go v1.0.0-beta3.0.20200610014412-d8bc0d1b9b30 h1:KlJmjQ5ZehOnYtffQ4/7vspv8rg47cckF2+etZ7MAgY=
63-
github.com/elastic/cloud-sdk-go v1.0.0-beta3.0.20200610014412-d8bc0d1b9b30/go.mod h1:+0Q5izB9Upzmolj6Pq4AkTsBwgDbQnNpODp3qFK7erQ=
64-
github.com/elastic/cloud-sdk-go v1.0.0-beta3.0.20200610061007-5771a049905a h1:Kt6uMlo1rtMXpHEHZBrkI1BGnTcHQhLyXloCj+jWKqI=
65-
github.com/elastic/cloud-sdk-go v1.0.0-beta3.0.20200610061007-5771a049905a/go.mod h1:+0Q5izB9Upzmolj6Pq4AkTsBwgDbQnNpODp3qFK7erQ=
6662
github.com/elastic/cloud-sdk-go v1.0.0-beta3.0.20200611025421-9b8340580ba3 h1:SdgBG2g5oH05SogNFHvJIRtjfye9Ay4GcEaDIr9n5YE=
6763
github.com/elastic/cloud-sdk-go v1.0.0-beta3.0.20200611025421-9b8340580ba3/go.mod h1:+0Q5izB9Upzmolj6Pq4AkTsBwgDbQnNpODp3qFK7erQ=
6864
github.com/fatih/color v1.7.0/go.mod h1:Zm6kSWBoL9eyXnKyktHP6abPY2pDugNf5KwzbycvMj4=

0 commit comments

Comments
 (0)