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:
Sebastiaan van Stijn 2022-01-20 14:11:00 +01:00
parent 784ba59a08
commit 091991606a
No known key found for this signature in database
GPG key ID: 76698F39D527CE8C
3 changed files with 4 additions and 6 deletions

View file

@ -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)

View file

@ -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`,

View file

@ -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
}