From 091991606a84961f5eb8ca28321d9e6a87b63ff4 Mon Sep 17 00:00:00 2001 From: Sebastiaan van Stijn Date: Thu, 20 Jan 2022 14:11:00 +0100 Subject: [PATCH] opts: format code with gofumpt Formatting the code with https://github.com/mvdan/gofumpt Signed-off-by: Sebastiaan van Stijn --- opts/address_pools_test.go | 4 ++-- opts/hosts_test.go | 4 +--- opts/opts.go | 2 +- 3 files changed, 4 insertions(+), 6 deletions(-) diff --git a/opts/address_pools_test.go b/opts/address_pools_test.go index 625ae1e18d..48d40e720d 100644 --- a/opts/address_pools_test.go +++ b/opts/address_pools_test.go @@ -6,8 +6,8 @@ import ( func TestAddressPoolOpt(t *testing.T) { poolopt := &PoolsOpt{} - var addresspool = "base=175.30.0.0/16,size=16" - var invalidAddresspoolString = "base=175.30.0.0/16,size=16, base=175.33.0.0/16,size=24" + addresspool := "base=175.30.0.0/16,size=16" + invalidAddresspoolString := "base=175.30.0.0/16,size=16, base=175.33.0.0/16,size=24" if err := poolopt.Set(addresspool); err != nil { t.Fatal(err) diff --git a/opts/hosts_test.go b/opts/hosts_test.go index 1f03b88d2e..9e217446dd 100644 --- a/opts/hosts_test.go +++ b/opts/hosts_test.go @@ -139,9 +139,7 @@ func TestParseDockerDaemonHost(t *testing.T) { } func TestParseTCP(t *testing.T) { - var ( - defaultHTTPHost = "tcp://127.0.0.1:8888" - ) + defaultHTTPHost := "tcp://127.0.0.1:8888" invalids := map[string]string{ "tcp:a.b.c.d": `invalid bind address (tcp:a.b.c.d): parse "tcp://tcp:a.b.c.d": invalid port ":a.b.c.d" after host`, "tcp:a.b.c.d/path": `invalid bind address (tcp:a.b.c.d/path): parse "tcp://tcp:a.b.c.d/path": invalid port ":a.b.c.d" after host`, diff --git a/opts/opts.go b/opts/opts.go index dbcd028525..b431f2a3d7 100644 --- a/opts/opts.go +++ b/opts/opts.go @@ -300,7 +300,7 @@ type ValidatorFctListType func(val string) ([]string, error) // ValidateIPAddress validates an Ip address. func ValidateIPAddress(val string) (string, error) { - var ip = net.ParseIP(strings.TrimSpace(val)) + ip := net.ParseIP(strings.TrimSpace(val)) if ip != nil { return ip.String(), nil }