Skip to content

Commit

Permalink
go fmt everything
Browse files Browse the repository at this point in the history
  • Loading branch information
andreasf committed May 15, 2018
1 parent 128de89 commit 67637d4
Show file tree
Hide file tree
Showing 24 changed files with 89 additions and 89 deletions.
4 changes: 2 additions & 2 deletions cfmysql/api_client.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,13 @@ import (
"encoding/json"
"fmt"

"bytes"
"code.cloudfoundry.org/cli/plugin"
sdkModels "code.cloudfoundry.org/cli/plugin/models"
pluginModels "github.com/andreasf/cf-mysql-plugin/cfmysql/models"
"github.com/andreasf/cf-mysql-plugin/cfmysql/resources"
"net/url"
"io"
"bytes"
"net/url"
)

//go:generate counterfeiter . ApiClient
Expand Down
4 changes: 2 additions & 2 deletions cfmysql/api_client_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,15 @@ import (
"errors"
"fmt"

"bytes"
"code.cloudfoundry.org/cli/plugin/models"
"code.cloudfoundry.org/cli/plugin/pluginfakes"
"github.com/andreasf/cf-mysql-plugin/cfmysql/cfmysqlfakes"
"github.com/andreasf/cf-mysql-plugin/cfmysql/models"
"github.com/andreasf/cf-mysql-plugin/cfmysql/test_resources"
. "github.com/onsi/ginkgo"
. "github.com/onsi/gomega"
"github.com/andreasf/cf-mysql-plugin/cfmysql/models"
"io"
"bytes"
)

var _ = Describe("ApiClient", func() {
Expand Down
4 changes: 2 additions & 2 deletions cfmysql/cf_service.go
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
package cfmysql

import (
"fmt"
"code.cloudfoundry.org/cli/plugin"
sdkModels "code.cloudfoundry.org/cli/plugin/models"
"fmt"
pluginModels "github.com/andreasf/cf-mysql-plugin/cfmysql/models"
"io"
)
Expand All @@ -22,7 +22,7 @@ func NewCfService(apiClient ApiClient, runner SshRunner, waiter PortWaiter, http
portWaiter: waiter,
httpClient: httpClient,
randWrapper: randWrapper,
logWriter: logWriter,
logWriter: logWriter,
}
}

Expand Down
12 changes: 6 additions & 6 deletions cfmysql/cf_service_test.go
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
package cfmysql_test

import (
. "github.com/andreasf/cf-mysql-plugin/cfmysql"
. "github.com/onsi/ginkgo"
. "github.com/onsi/gomega"
"code.cloudfoundry.org/cli/plugin/pluginfakes"
"code.cloudfoundry.org/cli/plugin/models"
"code.cloudfoundry.org/cli/cf/errors"
"github.com/andreasf/cf-mysql-plugin/cfmysql/cfmysqlfakes"
"code.cloudfoundry.org/cli/plugin"
"code.cloudfoundry.org/cli/plugin/models"
"code.cloudfoundry.org/cli/plugin/pluginfakes"
. "github.com/andreasf/cf-mysql-plugin/cfmysql"
"github.com/andreasf/cf-mysql-plugin/cfmysql/cfmysqlfakes"
"github.com/andreasf/cf-mysql-plugin/cfmysql/models"
. "github.com/onsi/ginkgo"
. "github.com/onsi/gomega"
"github.com/onsi/gomega/gbytes"
)

Expand Down
6 changes: 3 additions & 3 deletions cfmysql/http_client_factory.go
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
package cfmysql

import (
"net/http"
"crypto/tls"
"net/http"
)

//go:generate counterfeiter . HttpClientFactory
Expand All @@ -14,11 +14,11 @@ func NewHttpClientFactory() HttpClientFactory {
return new(httpClientFactory)
}

type httpClientFactory struct {}
type httpClientFactory struct{}

func (self *httpClientFactory) NewClient(sslDisabled bool) *http.Client {
transport := &http.Transport{
TLSClientConfig: &tls.Config{InsecureSkipVerify: sslDisabled},
}
return &http.Client{Transport: transport}
}
}
4 changes: 2 additions & 2 deletions cfmysql/http_wrapper.go
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
package cfmysql

import (
"code.cloudfoundry.org/cli/cf/net"
"fmt"
"io"
"io/ioutil"
"net/http"
"io"
"code.cloudfoundry.org/cli/cf/net"
)

//go:generate counterfeiter . HttpWrapper
Expand Down
6 changes: 3 additions & 3 deletions cfmysql/http_wrapper_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,11 @@ import (
"fmt"
"net/http"

"github.com/andreasf/cf-mysql-plugin/cfmysql"
"github.com/onsi/gomega/ghttp"
"github.com/andreasf/cf-mysql-plugin/cfmysql/cfmysqlfakes"
"bytes"
"code.cloudfoundry.org/cli/cf/net/netfakes"
"github.com/andreasf/cf-mysql-plugin/cfmysql"
"github.com/andreasf/cf-mysql-plugin/cfmysql/cfmysqlfakes"
"github.com/onsi/gomega/ghttp"
)

var _ = Describe("HttpWrapper", func() {
Expand Down
30 changes: 15 additions & 15 deletions cfmysql/models/models.go
Original file line number Diff line number Diff line change
@@ -1,27 +1,27 @@
package models

type ServiceInstance struct {
Name string
Guid string
Name string
Guid string
SpaceGuid string
}

type ServiceBinding struct {
ServiceInstanceGuid string
Uri string
DbName string
Hostname string
Port string
Username string
Password string
Uri string
DbName string
Hostname string
Port string
Username string
Password string
}

type ServiceKey struct {
ServiceInstanceGuid string
Uri string
DbName string
Hostname string
Port string
Username string
Password string
}
Uri string
DbName string
Hostname string
Port string
Username string
Password string
}
8 changes: 4 additions & 4 deletions cfmysql/mysql_runner.go
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
package cfmysql

import (
"os/exec"
"strconv"
"code.cloudfoundry.org/cli/cf/errors"
"fmt"
"os"
"os/exec"
"strconv"
"strings"
)

Expand Down Expand Up @@ -63,7 +63,7 @@ func (self *mysqlRunner) RunMysqlDump(hostname string, port int, dbName string,
}

tableArgs = append(tableArgs, argument)
nonTableArgs = mysqlDumpArgs[i + 1:]
nonTableArgs = mysqlDumpArgs[i+1:]
}

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

func (self *mysqlRunner) MakeMysqlCommand(hostname string, port int, dbName string, username string, password string) *exec.Cmd {
return exec.Command("mysql", "-u", "username", "-p" + password, "-h", "hostname", "-P", strconv.Itoa(port), dbName)
return exec.Command("mysql", "-u", "username", "-p"+password, "-h", "hostname", "-P", strconv.Itoa(port), dbName)
}
4 changes: 2 additions & 2 deletions cfmysql/mysql_runner_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@ package cfmysql_test
import (
. "github.com/andreasf/cf-mysql-plugin/cfmysql"

"errors"
"github.com/andreasf/cf-mysql-plugin/cfmysql/cfmysqlfakes"
. "github.com/onsi/ginkgo"
. "github.com/onsi/gomega"
"github.com/andreasf/cf-mysql-plugin/cfmysql/cfmysqlfakes"
"errors"
"os"
)

Expand Down
2 changes: 1 addition & 1 deletion cfmysql/net_wrapper.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ func NewNetWrapper() NetWrapper {
return new(netWrapper)
}

type netWrapper struct {}
type netWrapper struct{}

func (self *netWrapper) Dial(network, address string) (net.Conn, error) {
return net.Dial(network, address)
Expand Down
4 changes: 2 additions & 2 deletions cfmysql/os_wrapper.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ func NewOsWrapper() OsWrapper {
return new(osWrapper)
}

type osWrapper struct {}
type osWrapper struct{}

func (self *osWrapper) LookupEnv(key string) (string, bool) {
return os.LookupEnv(key)
}
}
4 changes: 2 additions & 2 deletions cfmysql/plugin.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@ package cfmysql

import (
"code.cloudfoundry.org/cli/plugin"
"io"
"fmt"
"code.cloudfoundry.org/cli/plugin/models"
"fmt"
"io"
)

type MysqlPlugin struct {
Expand Down
12 changes: 6 additions & 6 deletions cfmysql/plugin_test.go
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
package cfmysql_test

import (
"code.cloudfoundry.org/cli/cf/errors"
"code.cloudfoundry.org/cli/plugin"
"code.cloudfoundry.org/cli/plugin/models"
"code.cloudfoundry.org/cli/plugin/pluginfakes"
"fmt"
. "github.com/andreasf/cf-mysql-plugin/cfmysql"
"github.com/andreasf/cf-mysql-plugin/cfmysql/cfmysqlfakes"
. "github.com/onsi/ginkgo"
. "github.com/onsi/gomega"
"code.cloudfoundry.org/cli/plugin/pluginfakes"
"github.com/onsi/gomega/gbytes"
"github.com/andreasf/cf-mysql-plugin/cfmysql/cfmysqlfakes"
"code.cloudfoundry.org/cli/plugin"
"fmt"
"code.cloudfoundry.org/cli/plugin/models"
"code.cloudfoundry.org/cli/cf/errors"
)

var _ = Describe("Plugin", func() {
Expand Down
2 changes: 1 addition & 1 deletion cfmysql/port_finder.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ func NewPortFinder() PortFinder {
return new(portFinder)
}

type portFinder struct {}
type portFinder struct{}

func (self *portFinder) GetPort() int {
return freeport.GetPort()
Expand Down
4 changes: 2 additions & 2 deletions cfmysql/port_waiter.go
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
package cfmysql

import (
"time"
"strconv"
"errors"
"net"
"strconv"
"time"
)

//go:generate counterfeiter . PortWaiter
Expand Down
8 changes: 4 additions & 4 deletions cfmysql/port_waiter_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,12 @@ package cfmysql_test
import (
. "github.com/andreasf/cf-mysql-plugin/cfmysql"

"errors"
"github.com/andreasf/cf-mysql-plugin/cfmysql/cfmysqlfakes"
"github.com/andreasf/cf-mysql-plugin/cfmysql/netfakes"
. "github.com/onsi/ginkgo"
. "github.com/onsi/gomega"
"github.com/andreasf/cf-mysql-plugin/cfmysql/cfmysqlfakes"
"net"
"errors"
"github.com/andreasf/cf-mysql-plugin/cfmysql/netfakes"
)

var _ = Describe("PortWaiter", func() {
Expand All @@ -18,7 +18,7 @@ var _ = Describe("PortWaiter", func() {
const SucceedAfterTries = 5
dialCount := 0
mockDial := func(network, address string) (net.Conn, error) {
if dialCount < SucceedAfterTries- 1 {
if dialCount < SucceedAfterTries-1 {
dialCount++
return nil, errors.New("GURU MEDITATION")
}
Expand Down
4 changes: 2 additions & 2 deletions cfmysql/request_dumper.go
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
package cfmysql

import (
"code.cloudfoundry.org/cli/cf/i18n"
"code.cloudfoundry.org/cli/cf/net"
"code.cloudfoundry.org/cli/cf/trace"
"io"
"net/http"
"code.cloudfoundry.org/cli/cf/i18n"
"code.cloudfoundry.org/cli/cf/trace"
)

type conditionalRequestDumper struct {
Expand Down
22 changes: 11 additions & 11 deletions cfmysql/request_dumper_test.go
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
package cfmysql_test

import (
. "github.com/onsi/ginkgo"
. "github.com/onsi/gomega"
"code.cloudfoundry.org/cli/cf/terminal"
"github.com/andreasf/cf-mysql-plugin/cfmysql"
"github.com/andreasf/cf-mysql-plugin/cfmysql/cfmysqlfakes"
"net/http"
"regexp"
. "github.com/onsi/ginkgo"
. "github.com/onsi/gomega"
"github.com/onsi/gomega/gbytes"
"code.cloudfoundry.org/cli/cf/terminal"
"net/http"
"net/url"
"regexp"
)

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

request = http.Request{
Method: "BARK",
URL: url,
Proto: "HTTP/1.1",
Method: "BARK",
URL: url,
Proto: "HTTP/1.1",
ProtoMajor: 1,
ProtoMinor: 1,
}

response = http.Response{
Status: "BORK",
Status: "BORK",
StatusCode: 200,
Proto: "HTTP/1.1",
Proto: "HTTP/1.1",
ProtoMajor: 1,
ProtoMinor: 1,
}
Expand Down Expand Up @@ -109,4 +109,4 @@ func removeTimestampAndColors(requestOrResponse []byte) string {
withoutTimestamp := string(re.ReplaceAll([]byte(withoutColors), []byte("[timestamp]")))

return withoutTimestamp
}
}
Loading

0 comments on commit 67637d4

Please sign in to comment.