libnetwork/drivers/remote: format code with gofumpt

Formatting the code with https://github.com/mvdan/gofumpt

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
This commit is contained in:
Sebastiaan van Stijn 2022-01-20 14:01:51 +01:00
parent 485977de57
commit dc17f5e613
No known key found for this signature in database
GPG key ID: 76698F39D527CE8C
2 changed files with 11 additions and 12 deletions

View file

@ -393,7 +393,7 @@ func (d *driver) DiscoverDelete(dType discoverapi.DiscoveryType, data interface{
}
func parseStaticRoutes(r api.JoinResponse) ([]*types.StaticRoute, error) {
var routes = make([]*types.StaticRoute, len(r.StaticRoutes))
routes := make([]*types.StaticRoute, len(r.StaticRoutes))
for i, inRoute := range r.StaticRoutes {
var err error
outRoute := &types.StaticRoute{RouteType: inRoute.RouteType}

View file

@ -46,7 +46,7 @@ func setupPlugin(t *testing.T, name string, mux *http.ServeMux) func() {
specPath = filepath.Join(os.Getenv("programdata"), "docker", "plugins")
}
if err := os.MkdirAll(specPath, 0755); err != nil {
if err := os.MkdirAll(specPath, 0o755); err != nil {
t.Fatal(err)
}
@ -61,7 +61,7 @@ func setupPlugin(t *testing.T, name string, mux *http.ServeMux) func() {
t.Fatal("Failed to start an HTTP Server")
}
if err := os.WriteFile(filepath.Join(specPath, name+".spec"), []byte(server.URL), 0644); err != nil {
if err := os.WriteFile(filepath.Join(specPath, name+".spec"), []byte(server.URL), 0o644); err != nil {
t.Fatal(err)
}
@ -216,7 +216,7 @@ func (test *testEndpoint) AddTableEntry(tableName string, key string, value []by
}
func TestGetEmptyCapabilities(t *testing.T) {
var plugin = "test-net-driver-empty-cap"
plugin := "test-net-driver-empty-cap"
mux := http.NewServeMux()
defer setupPlugin(t, plugin, mux)()
@ -246,7 +246,7 @@ func TestGetEmptyCapabilities(t *testing.T) {
}
func TestGetExtraCapabilities(t *testing.T) {
var plugin = "test-net-driver-extra-cap"
plugin := "test-net-driver-extra-cap"
mux := http.NewServeMux()
defer setupPlugin(t, plugin, mux)()
@ -284,7 +284,7 @@ func TestGetExtraCapabilities(t *testing.T) {
}
func TestGetInvalidCapabilities(t *testing.T) {
var plugin = "test-net-driver-invalid-cap"
plugin := "test-net-driver-invalid-cap"
mux := http.NewServeMux()
defer setupPlugin(t, plugin, mux)()
@ -316,7 +316,7 @@ func TestGetInvalidCapabilities(t *testing.T) {
}
func TestRemoteDriver(t *testing.T) {
var plugin = "test-net-driver"
plugin := "test-net-driver"
ep := &testEndpoint{
t: t,
@ -484,7 +484,7 @@ func TestRemoteDriver(t *testing.T) {
}
func TestDriverError(t *testing.T) {
var plugin = "test-net-driver-error"
plugin := "test-net-driver-error"
mux := http.NewServeMux()
defer setupPlugin(t, plugin, mux)()
@ -512,7 +512,7 @@ func TestDriverError(t *testing.T) {
}
func TestMissingValues(t *testing.T) {
var plugin = "test-net-driver-missing"
plugin := "test-net-driver-missing"
mux := http.NewServeMux()
defer setupPlugin(t, plugin, mux)()
@ -548,8 +548,7 @@ func TestMissingValues(t *testing.T) {
}
}
type rollbackEndpoint struct {
}
type rollbackEndpoint struct{}
func (r *rollbackEndpoint) Interface() driverapi.InterfaceInfo {
return r
@ -576,7 +575,7 @@ func (r *rollbackEndpoint) SetIPAddress(ip *net.IPNet) error {
}
func TestRollback(t *testing.T) {
var plugin = "test-net-driver-rollback"
plugin := "test-net-driver-rollback"
mux := http.NewServeMux()
defer setupPlugin(t, plugin, mux)()