Explorar el Código

api/types: format code with gofumpt

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

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
Sebastiaan van Stijn hace 3 años
padre
commit
3146ecbae6
Se han modificado 2 ficheros con 65 adiciones y 37 borrados
  1. 0 1
      api/types/container/hostconfig_unix_test.go
  2. 65 36
      api/types/filters/parse_test.go

+ 0 - 1
api/types/container/hostconfig_unix_test.go

@@ -155,7 +155,6 @@ func TestUTSMode(t *testing.T) {
 			assert.Check(t, is.Equal(mode.IsHost(), expected.host))
 			assert.Check(t, is.Equal(mode.Valid(), expected.valid))
 		})
-
 	}
 }
 

+ 65 - 36
api/types/filters/parse_test.go

@@ -164,13 +164,17 @@ func TestArgsMatchKVList(t *testing.T) {
 
 	matches := map[*Args]string{
 		{}: "field",
-		{map[string]map[string]bool{
-			"created": {"today": true},
-			"labels":  {"key1": true}},
+		{
+			map[string]map[string]bool{
+				"created": {"today": true},
+				"labels":  {"key1": true},
+			},
 		}: "labels",
-		{map[string]map[string]bool{
-			"created": {"today": true},
-			"labels":  {"key1=value1": true}},
+		{
+			map[string]map[string]bool{
+				"created": {"today": true},
+				"labels":  {"key1=value1": true},
+			},
 		}: "labels",
 	}
 
@@ -181,16 +185,22 @@ func TestArgsMatchKVList(t *testing.T) {
 	}
 
 	differs := map[*Args]string{
-		{map[string]map[string]bool{
-			"created": {"today": true}},
+		{
+			map[string]map[string]bool{
+				"created": {"today": true},
+			},
 		}: "created",
-		{map[string]map[string]bool{
-			"created": {"today": true},
-			"labels":  {"key4": true}},
+		{
+			map[string]map[string]bool{
+				"created": {"today": true},
+				"labels":  {"key4": true},
+			},
 		}: "labels",
-		{map[string]map[string]bool{
-			"created": {"today": true},
-			"labels":  {"key1=value3": true}},
+		{
+			map[string]map[string]bool{
+				"created": {"today": true},
+				"labels":  {"key1=value3": true},
+			},
 		}: "labels",
 	}
 
@@ -206,20 +216,30 @@ func TestArgsMatch(t *testing.T) {
 
 	matches := map[*Args]string{
 		{}: "field",
-		{map[string]map[string]bool{
-			"created": {"today": true}},
+		{
+			map[string]map[string]bool{
+				"created": {"today": true},
+			},
 		}: "today",
-		{map[string]map[string]bool{
-			"created": {"to*": true}},
+		{
+			map[string]map[string]bool{
+				"created": {"to*": true},
+			},
 		}: "created",
-		{map[string]map[string]bool{
-			"created": {"to(.*)": true}},
+		{
+			map[string]map[string]bool{
+				"created": {"to(.*)": true},
+			},
 		}: "created",
-		{map[string]map[string]bool{
-			"created": {"tod": true}},
+		{
+			map[string]map[string]bool{
+				"created": {"tod": true},
+			},
 		}: "created",
-		{map[string]map[string]bool{
-			"created": {"anything": true, "to*": true}},
+		{
+			map[string]map[string]bool{
+				"created": {"anything": true, "to*": true},
+			},
 		}: "created",
 	}
 
@@ -229,21 +249,31 @@ func TestArgsMatch(t *testing.T) {
 	}
 
 	differs := map[*Args]string{
-		{map[string]map[string]bool{
-			"created": {"tomorrow": true}},
+		{
+			map[string]map[string]bool{
+				"created": {"tomorrow": true},
+			},
 		}: "created",
-		{map[string]map[string]bool{
-			"created": {"to(day": true}},
+		{
+			map[string]map[string]bool{
+				"created": {"to(day": true},
+			},
 		}: "created",
-		{map[string]map[string]bool{
-			"created": {"tom(.*)": true}},
+		{
+			map[string]map[string]bool{
+				"created": {"tom(.*)": true},
+			},
 		}: "created",
-		{map[string]map[string]bool{
-			"created": {"tom": true}},
+		{
+			map[string]map[string]bool{
+				"created": {"tom": true},
+			},
 		}: "created",
-		{map[string]map[string]bool{
-			"created": {"today1": true},
-			"labels":  {"today": true}},
+		{
+			map[string]map[string]bool{
+				"created": {"today1": true},
+				"labels":  {"today": true},
+			},
 		}: "created",
 	}
 
@@ -532,5 +562,4 @@ func TestGetBoolOrDefault(t *testing.T) {
 			assert.Check(t, is.Equal(tC.expectedValue, value))
 		})
 	}
-
 }