mirror of
https://github.com/moby/moby.git
synced 2026-01-11 18:51:37 +00:00
opts: 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:
@@ -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)
|
||||
|
||||
@@ -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`,
|
||||
|
||||
@@ -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
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user