Skip to content

Commit

Permalink
lint
Browse files Browse the repository at this point in the history
  • Loading branch information
jessicatoscani committed Aug 11, 2023
1 parent 4320f69 commit 3e0ca1d
Show file tree
Hide file tree
Showing 7 changed files with 2 additions and 153 deletions.
20 changes: 0 additions & 20 deletions cmd/cmd.go
Original file line number Diff line number Diff line change
Expand Up @@ -107,26 +107,6 @@ func cmdShowHelpFlags(flags *pflag.FlagSet, prefix string) {
fmt.Print(buf)
}

func getCommaflag(p string) []string {
if p == "" {
return nil
}

p = strings.Trim(p, ",")
args := strings.Split(p, ",")

res := []string{}

for _, arg := range args {
if arg == "" {
continue
}
res = append(res, strings.TrimSpace(arg))
}

return res
}

// cliCommandSettings represents a CLI command settings.
type cliCommandSettings struct {
outputFunc func(o output.Outputter, err error) error
Expand Down
9 changes: 2 additions & 7 deletions cmd/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -265,20 +265,15 @@ func chooseZone(client *egoscale.Client, zones []string) (string, error) {
if zones == nil {

ctx := exoapi.WithEndpoint(gContext, exoapi.NewReqEndpoint(defaultEnvironment, defaultZone))
zonesResp, err := client.ListZones(ctx)
zones, err := client.ListZones(ctx)

if err != nil {
return "", err
}

if len(zonesResp) == 0 {
if len(zones) == 0 {
return "", fmt.Errorf("no zones were found")
}
zones = make([]string, len(zonesResp))
for i, z := range zonesResp {
zones[i] = z
}

}

prompt := promptui.Select{
Expand Down
102 changes: 0 additions & 102 deletions cmd/flags.go

This file was deleted.

4 changes: 0 additions & 4 deletions cmd/icmp_code.go
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,3 @@ func (i icmpCode) StringFormatted() string {
}
return cases.Title(language.Und).String(res)
}

func (i icmpCode) icmpType() icmpType {
return icmpType(i >> 8)
}
4 changes: 0 additions & 4 deletions cmd/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,12 +33,8 @@ var gAccountName string
var gListAlias = []string{"ls"}
var gRemoveAlias = []string{"rm"}
var gDeleteAlias = []string{"del"}
var gRevokeAlias = []string{"rvk"}
var gShowAlias = []string{"get"}
var gCreateAlias = []string{"add"}
var gUploadAlias = []string{"up"}
var gDissociateAlias = []string{"disassociate", "dissoc"}
var gAssociateAlias = []string{"assoc"}

var RootCmd = &cobra.Command{
Use: "exo",
Expand Down
10 changes: 0 additions & 10 deletions cmd/zone.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,16 +25,6 @@ var (
string(oapi.ZoneNameDeFra1),
string(oapi.ZoneNameDeMuc1),
}

zoneHelp = "zone NAME|ID " + func() string {
zonesList := "("

for _, zone := range allZones {
zonesList += zone + "|"
}

return zonesList[:len(zonesList)-1] + ")"
}()
)

type zoneListItemOutput struct {
Expand Down
6 changes: 0 additions & 6 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -166,8 +166,6 @@ github.com/envoyproxy/go-control-plane v0.9.10-0.20210907150352-cf90f659a021/go.
github.com/envoyproxy/go-control-plane v0.10.1/go.mod h1:AY7fTTXNdv/aJ2O5jwpxAPOWUZ7hQAEvzN5Pf27BkQQ=
github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c=
github.com/envoyproxy/protoc-gen-validate v0.6.2/go.mod h1:2t7qjJNvHPx8IjnBOzl9E9/baC+qXE/TeeyBRzgJDws=
github.com/exoscale/egoscale v0.100.1 h1:iXsV1Ei7daqe/6FYSCSDyrFs1iUG1l1X9qNh2uMw6z0=
github.com/exoscale/egoscale v0.100.1/go.mod h1:BAb9p4rmyU+Wl400CJZO5270H2sXtdsZjLcm5xMKkz4=
github.com/exoscale/egoscale v0.100.3 h1:zyl/pdmGbpoYUndVkV9DAkFMiO8/4S0DIAk0R1K53J4=
github.com/exoscale/egoscale v0.100.3/go.mod h1:szh4hWSVh+ylgfti4AFR4mkRaCfUyUXSKS3PihlcOco=
github.com/exoscale/openapi-cli-generator v1.1.0 h1:fYjmPqHR5vxlOBrbvde7eo7bISNQIFxsGn4A5/acwKA=
Expand Down Expand Up @@ -206,8 +204,6 @@ github.com/go-playground/validator/v10 v10.9.0/go.mod h1:74x4gJWsvQexRdW8Pn3dXSG
github.com/go-stack/stack v1.8.0/go.mod h1:v0f6uXyyMGvRgIKkXu+yp6POWl0qKG85gN/melR3HDY=
github.com/goccy/go-json v0.7.8/go.mod h1:6MelG93GURQebXPDq3khkgXZkazVtN9CRI+MGFi0w8I=
github.com/godbus/dbus/v5 v5.0.4/go.mod h1:xhWf0FNVPg57R7Z0UbKHbJfkEywrmjJnf7w5xrFpKfA=
github.com/gofrs/uuid v4.0.0+incompatible h1:1SD/1F5pU8p29ybwgQSwpQk+mwdRrXCYuPhW6m+TnJw=
github.com/gofrs/uuid v4.0.0+incompatible/go.mod h1:b2aQJv3Z4Fp6yNu3cdSllBxTCLRxnplIgP/c0N/04lM=
github.com/gofrs/uuid v4.4.0+incompatible h1:3qXRTX8/NbyulANqlc0lchS1gqAVxRgsuW1YrTJupqA=
github.com/gofrs/uuid v4.4.0+incompatible/go.mod h1:b2aQJv3Z4Fp6yNu3cdSllBxTCLRxnplIgP/c0N/04lM=
github.com/gogo/protobuf v1.1.1/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ=
Expand Down Expand Up @@ -519,8 +515,6 @@ github.com/stretchr/testify v1.6.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/
github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU=
github.com/stretchr/testify v1.8.1 h1:w7B6lhMri9wdJUVmEZPGGhZzrYTPvgJArz7wNPgYKsk=
github.com/stretchr/testify v1.8.1/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4=
github.com/stretchr/testify v1.8.2 h1:+h33VjcLVPDHtOdpUCuF+7gSuG3yGIftsP1YvFihtJ8=
github.com/stretchr/testify v1.8.2/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4=
github.com/subosito/gotenv v1.2.0 h1:Slr1R9HxAlEKefgq5jn9U+DnETlIUa6HfgEzj0g5d7s=
Expand Down

0 comments on commit 3e0ca1d

Please sign in to comment.