Skip to content

Commit

Permalink
Run gofmt on commands do and integration (#868)
Browse files Browse the repository at this point in the history
  • Loading branch information
Baptiste Prunot authored Oct 5, 2020
1 parent ac645f1 commit 77fe6a5
Show file tree
Hide file tree
Showing 6 changed files with 13 additions and 14 deletions.
2 changes: 1 addition & 1 deletion commands/displayers/vpc.go
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ func (v *VPC) KV() []map[string]interface{} {
"URN": v.URN,
"Name": v.Name,
"Description": v.Description,
"IPRange": v.IPRange,
"IPRange": v.IPRange,
"Created": v.CreatedAt,
"Region": v.RegionSlug,
"Default": v.Default,
Expand Down
4 changes: 2 additions & 2 deletions commands/kubernetes_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ var (
APIVersion: "v1",
CurrentContext: "test-context",
Contexts: map[string]*clientcmdapi.Context{
"test-context": &clientcmdapi.Context{
"test-context": {
Cluster: "test-cluster",
},
},
Expand Down Expand Up @@ -434,7 +434,7 @@ func TestKubernetesCreate(t *testing.T) {
assert.NoError(t, err)

// Test with 1-clicks specified
config.Doit.Set(config.NS, doctl.ArgOneClicks, []string{"slug1","slug2"})
config.Doit.Set(config.NS, doctl.ArgOneClicks, []string{"slug1", "slug2"})
tm.kubernetes.EXPECT().Create(&r).Return(&testCluster, nil)
tm.oneClick.EXPECT().InstallKubernetes(testCluster.ID, []string{"slug1", "slug2"})
err = testK8sCmdService().RunKubernetesClusterCreate("c-8", 3)(config)
Expand Down
14 changes: 7 additions & 7 deletions do/1_clicks.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ import (
// OneClickService is the godo OneClickService interface.
type OneClickService interface {
List(string) (OneClicks, error)
InstallKubernetes(string, []string)(string, error)
InstallKubernetes(string, []string) (string, error)
}

var _ OneClickService = &oneClickService{}
Expand Down Expand Up @@ -77,16 +77,16 @@ func (ocs *oneClickService) List(oneClickType string) (OneClicks, error) {
return list, nil
}

func (ocs *oneClickService) InstallKubernetes(clusterUUID string, slugs []string)(string, error){
installReq := &godo.InstallKubernetesAppsRequest {
Slugs: slugs,
func (ocs *oneClickService) InstallKubernetes(clusterUUID string, slugs []string) (string, error) {
installReq := &godo.InstallKubernetesAppsRequest{
Slugs: slugs,
ClusterUUID: clusterUUID,
}
}

responseMessage, _, err := ocs.Client.OneClick.InstallKubernetes(context.TODO(), installReq)
if err != nil {
return "", err
}
return responseMessage.Message , nil

return responseMessage.Message, nil
}
1 change: 0 additions & 1 deletion integration/kubernetes_clusters_create_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -300,4 +300,3 @@ current-context: some-context
}
`
)

4 changes: 2 additions & 2 deletions integration/registry_login_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ var _ = suite("registry/login", func(t *testing.T, when spec.G, it spec.S) {
expect.NoError(err)

expect.Equal("Logging Docker in to registry.digitalocean.com\n", string(output))
for host, _ := range dc.Auths {
for host := range dc.Auths {
expect.Equal("registry.digitalocean.com", host)
}
})
Expand Down Expand Up @@ -128,7 +128,7 @@ var _ = suite("registry/login", func(t *testing.T, when spec.G, it spec.S) {
expect.NoError(err)

expect.Equal("Logging Docker in to registry.digitalocean.com\n", string(output))
for host, _ := range dc.Auths {
for host := range dc.Auths {
expect.Equal("expiring.registry.com", host)
}
})
Expand Down
2 changes: 1 addition & 1 deletion integration/vpc_update_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -109,4 +109,4 @@ ID URN
}
}
`
)
)

0 comments on commit 77fe6a5

Please sign in to comment.