Skip to content

Commit 67637d4

Browse files
committed
go fmt everything
1 parent 128de89 commit 67637d4

24 files changed

+89
-89
lines changed

cfmysql/api_client.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,13 @@ import (
44
"encoding/json"
55
"fmt"
66

7+
"bytes"
78
"code.cloudfoundry.org/cli/plugin"
89
sdkModels "code.cloudfoundry.org/cli/plugin/models"
910
pluginModels "github.com/andreasf/cf-mysql-plugin/cfmysql/models"
1011
"github.com/andreasf/cf-mysql-plugin/cfmysql/resources"
11-
"net/url"
1212
"io"
13-
"bytes"
13+
"net/url"
1414
)
1515

1616
//go:generate counterfeiter . ApiClient

cfmysql/api_client_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,15 +6,15 @@ import (
66
"errors"
77
"fmt"
88

9+
"bytes"
910
"code.cloudfoundry.org/cli/plugin/models"
1011
"code.cloudfoundry.org/cli/plugin/pluginfakes"
1112
"github.com/andreasf/cf-mysql-plugin/cfmysql/cfmysqlfakes"
13+
"github.com/andreasf/cf-mysql-plugin/cfmysql/models"
1214
"github.com/andreasf/cf-mysql-plugin/cfmysql/test_resources"
1315
. "github.com/onsi/ginkgo"
1416
. "github.com/onsi/gomega"
15-
"github.com/andreasf/cf-mysql-plugin/cfmysql/models"
1617
"io"
17-
"bytes"
1818
)
1919

2020
var _ = Describe("ApiClient", func() {

cfmysql/cf_service.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
package cfmysql
22

33
import (
4-
"fmt"
54
"code.cloudfoundry.org/cli/plugin"
65
sdkModels "code.cloudfoundry.org/cli/plugin/models"
6+
"fmt"
77
pluginModels "github.com/andreasf/cf-mysql-plugin/cfmysql/models"
88
"io"
99
)
@@ -22,7 +22,7 @@ func NewCfService(apiClient ApiClient, runner SshRunner, waiter PortWaiter, http
2222
portWaiter: waiter,
2323
httpClient: httpClient,
2424
randWrapper: randWrapper,
25-
logWriter: logWriter,
25+
logWriter: logWriter,
2626
}
2727
}
2828

cfmysql/cf_service_test.go

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
11
package cfmysql_test
22

33
import (
4-
. "github.com/andreasf/cf-mysql-plugin/cfmysql"
5-
. "github.com/onsi/ginkgo"
6-
. "github.com/onsi/gomega"
7-
"code.cloudfoundry.org/cli/plugin/pluginfakes"
8-
"code.cloudfoundry.org/cli/plugin/models"
94
"code.cloudfoundry.org/cli/cf/errors"
10-
"github.com/andreasf/cf-mysql-plugin/cfmysql/cfmysqlfakes"
115
"code.cloudfoundry.org/cli/plugin"
6+
"code.cloudfoundry.org/cli/plugin/models"
7+
"code.cloudfoundry.org/cli/plugin/pluginfakes"
8+
. "github.com/andreasf/cf-mysql-plugin/cfmysql"
9+
"github.com/andreasf/cf-mysql-plugin/cfmysql/cfmysqlfakes"
1210
"github.com/andreasf/cf-mysql-plugin/cfmysql/models"
11+
. "github.com/onsi/ginkgo"
12+
. "github.com/onsi/gomega"
1313
"github.com/onsi/gomega/gbytes"
1414
)
1515

cfmysql/http_client_factory.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
package cfmysql
22

33
import (
4-
"net/http"
54
"crypto/tls"
5+
"net/http"
66
)
77

88
//go:generate counterfeiter . HttpClientFactory
@@ -14,11 +14,11 @@ func NewHttpClientFactory() HttpClientFactory {
1414
return new(httpClientFactory)
1515
}
1616

17-
type httpClientFactory struct {}
17+
type httpClientFactory struct{}
1818

1919
func (self *httpClientFactory) NewClient(sslDisabled bool) *http.Client {
2020
transport := &http.Transport{
2121
TLSClientConfig: &tls.Config{InsecureSkipVerify: sslDisabled},
2222
}
2323
return &http.Client{Transport: transport}
24-
}
24+
}

cfmysql/http_wrapper.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
package cfmysql
22

33
import (
4+
"code.cloudfoundry.org/cli/cf/net"
45
"fmt"
6+
"io"
57
"io/ioutil"
68
"net/http"
7-
"io"
8-
"code.cloudfoundry.org/cli/cf/net"
99
)
1010

1111
//go:generate counterfeiter . HttpWrapper

cfmysql/http_wrapper_test.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,11 @@ import (
77
"fmt"
88
"net/http"
99

10-
"github.com/andreasf/cf-mysql-plugin/cfmysql"
11-
"github.com/onsi/gomega/ghttp"
12-
"github.com/andreasf/cf-mysql-plugin/cfmysql/cfmysqlfakes"
1310
"bytes"
1411
"code.cloudfoundry.org/cli/cf/net/netfakes"
12+
"github.com/andreasf/cf-mysql-plugin/cfmysql"
13+
"github.com/andreasf/cf-mysql-plugin/cfmysql/cfmysqlfakes"
14+
"github.com/onsi/gomega/ghttp"
1515
)
1616

1717
var _ = Describe("HttpWrapper", func() {

cfmysql/models/models.go

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,27 @@
11
package models
22

33
type ServiceInstance struct {
4-
Name string
5-
Guid string
4+
Name string
5+
Guid string
66
SpaceGuid string
77
}
88

99
type ServiceBinding struct {
1010
ServiceInstanceGuid string
11-
Uri string
12-
DbName string
13-
Hostname string
14-
Port string
15-
Username string
16-
Password string
11+
Uri string
12+
DbName string
13+
Hostname string
14+
Port string
15+
Username string
16+
Password string
1717
}
1818

1919
type ServiceKey struct {
2020
ServiceInstanceGuid string
21-
Uri string
22-
DbName string
23-
Hostname string
24-
Port string
25-
Username string
26-
Password string
27-
}
21+
Uri string
22+
DbName string
23+
Hostname string
24+
Port string
25+
Username string
26+
Password string
27+
}

cfmysql/mysql_runner.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
package cfmysql
22

33
import (
4-
"os/exec"
5-
"strconv"
64
"code.cloudfoundry.org/cli/cf/errors"
75
"fmt"
86
"os"
7+
"os/exec"
8+
"strconv"
99
"strings"
1010
)
1111

@@ -63,7 +63,7 @@ func (self *mysqlRunner) RunMysqlDump(hostname string, port int, dbName string,
6363
}
6464

6565
tableArgs = append(tableArgs, argument)
66-
nonTableArgs = mysqlDumpArgs[i + 1:]
66+
nonTableArgs = mysqlDumpArgs[i+1:]
6767
}
6868

6969
args := []string{"-u", username, "-p" + password, "-h", hostname, "-P", strconv.Itoa(port)}
@@ -85,5 +85,5 @@ func (self *mysqlRunner) RunMysqlDump(hostname string, port int, dbName string,
8585
}
8686

8787
func (self *mysqlRunner) MakeMysqlCommand(hostname string, port int, dbName string, username string, password string) *exec.Cmd {
88-
return exec.Command("mysql", "-u", "username", "-p" + password, "-h", "hostname", "-P", strconv.Itoa(port), dbName)
88+
return exec.Command("mysql", "-u", "username", "-p"+password, "-h", "hostname", "-P", strconv.Itoa(port), dbName)
8989
}

cfmysql/mysql_runner_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,10 @@ package cfmysql_test
33
import (
44
. "github.com/andreasf/cf-mysql-plugin/cfmysql"
55

6+
"errors"
7+
"github.com/andreasf/cf-mysql-plugin/cfmysql/cfmysqlfakes"
68
. "github.com/onsi/ginkgo"
79
. "github.com/onsi/gomega"
8-
"github.com/andreasf/cf-mysql-plugin/cfmysql/cfmysqlfakes"
9-
"errors"
1010
"os"
1111
)
1212

cfmysql/net_wrapper.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ func NewNetWrapper() NetWrapper {
1212
return new(netWrapper)
1313
}
1414

15-
type netWrapper struct {}
15+
type netWrapper struct{}
1616

1717
func (self *netWrapper) Dial(network, address string) (net.Conn, error) {
1818
return net.Dial(network, address)

cfmysql/os_wrapper.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@ func NewOsWrapper() OsWrapper {
1111
return new(osWrapper)
1212
}
1313

14-
type osWrapper struct {}
14+
type osWrapper struct{}
1515

1616
func (self *osWrapper) LookupEnv(key string) (string, bool) {
1717
return os.LookupEnv(key)
18-
}
18+
}

cfmysql/plugin.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@ package cfmysql
22

33
import (
44
"code.cloudfoundry.org/cli/plugin"
5-
"io"
6-
"fmt"
75
"code.cloudfoundry.org/cli/plugin/models"
6+
"fmt"
7+
"io"
88
)
99

1010
type MysqlPlugin struct {

cfmysql/plugin_test.go

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,16 @@
11
package cfmysql_test
22

33
import (
4+
"code.cloudfoundry.org/cli/cf/errors"
5+
"code.cloudfoundry.org/cli/plugin"
6+
"code.cloudfoundry.org/cli/plugin/models"
7+
"code.cloudfoundry.org/cli/plugin/pluginfakes"
8+
"fmt"
49
. "github.com/andreasf/cf-mysql-plugin/cfmysql"
10+
"github.com/andreasf/cf-mysql-plugin/cfmysql/cfmysqlfakes"
511
. "github.com/onsi/ginkgo"
612
. "github.com/onsi/gomega"
7-
"code.cloudfoundry.org/cli/plugin/pluginfakes"
813
"github.com/onsi/gomega/gbytes"
9-
"github.com/andreasf/cf-mysql-plugin/cfmysql/cfmysqlfakes"
10-
"code.cloudfoundry.org/cli/plugin"
11-
"fmt"
12-
"code.cloudfoundry.org/cli/plugin/models"
13-
"code.cloudfoundry.org/cli/cf/errors"
1414
)
1515

1616
var _ = Describe("Plugin", func() {

cfmysql/port_finder.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ func NewPortFinder() PortFinder {
1111
return new(portFinder)
1212
}
1313

14-
type portFinder struct {}
14+
type portFinder struct{}
1515

1616
func (self *portFinder) GetPort() int {
1717
return freeport.GetPort()

cfmysql/port_waiter.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
package cfmysql
22

33
import (
4-
"time"
5-
"strconv"
64
"errors"
75
"net"
6+
"strconv"
7+
"time"
88
)
99

1010
//go:generate counterfeiter . PortWaiter

cfmysql/port_waiter_test.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,12 @@ package cfmysql_test
33
import (
44
. "github.com/andreasf/cf-mysql-plugin/cfmysql"
55

6+
"errors"
7+
"github.com/andreasf/cf-mysql-plugin/cfmysql/cfmysqlfakes"
8+
"github.com/andreasf/cf-mysql-plugin/cfmysql/netfakes"
69
. "github.com/onsi/ginkgo"
710
. "github.com/onsi/gomega"
8-
"github.com/andreasf/cf-mysql-plugin/cfmysql/cfmysqlfakes"
911
"net"
10-
"errors"
11-
"github.com/andreasf/cf-mysql-plugin/cfmysql/netfakes"
1212
)
1313

1414
var _ = Describe("PortWaiter", func() {
@@ -18,7 +18,7 @@ var _ = Describe("PortWaiter", func() {
1818
const SucceedAfterTries = 5
1919
dialCount := 0
2020
mockDial := func(network, address string) (net.Conn, error) {
21-
if dialCount < SucceedAfterTries- 1 {
21+
if dialCount < SucceedAfterTries-1 {
2222
dialCount++
2323
return nil, errors.New("GURU MEDITATION")
2424
}

cfmysql/request_dumper.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
package cfmysql
22

33
import (
4+
"code.cloudfoundry.org/cli/cf/i18n"
45
"code.cloudfoundry.org/cli/cf/net"
6+
"code.cloudfoundry.org/cli/cf/trace"
57
"io"
68
"net/http"
7-
"code.cloudfoundry.org/cli/cf/i18n"
8-
"code.cloudfoundry.org/cli/cf/trace"
99
)
1010

1111
type conditionalRequestDumper struct {

cfmysql/request_dumper_test.go

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
11
package cfmysql_test
22

33
import (
4-
. "github.com/onsi/ginkgo"
5-
. "github.com/onsi/gomega"
4+
"code.cloudfoundry.org/cli/cf/terminal"
65
"github.com/andreasf/cf-mysql-plugin/cfmysql"
76
"github.com/andreasf/cf-mysql-plugin/cfmysql/cfmysqlfakes"
8-
"net/http"
9-
"regexp"
7+
. "github.com/onsi/ginkgo"
8+
. "github.com/onsi/gomega"
109
"github.com/onsi/gomega/gbytes"
11-
"code.cloudfoundry.org/cli/cf/terminal"
10+
"net/http"
1211
"net/url"
12+
"regexp"
1313
)
1414

1515
var _ = Describe("RequestDumper", func() {
@@ -24,17 +24,17 @@ var _ = Describe("RequestDumper", func() {
2424
Expect(err).To(BeNil())
2525

2626
request = http.Request{
27-
Method: "BARK",
28-
URL: url,
29-
Proto: "HTTP/1.1",
27+
Method: "BARK",
28+
URL: url,
29+
Proto: "HTTP/1.1",
3030
ProtoMajor: 1,
3131
ProtoMinor: 1,
3232
}
3333

3434
response = http.Response{
35-
Status: "BORK",
35+
Status: "BORK",
3636
StatusCode: 200,
37-
Proto: "HTTP/1.1",
37+
Proto: "HTTP/1.1",
3838
ProtoMajor: 1,
3939
ProtoMinor: 1,
4040
}
@@ -109,4 +109,4 @@ func removeTimestampAndColors(requestOrResponse []byte) string {
109109
withoutTimestamp := string(re.ReplaceAll([]byte(withoutColors), []byte("[timestamp]")))
110110

111111
return withoutTimestamp
112-
}
112+
}

0 commit comments

Comments
 (0)