Run a more strict formatter over the code (#11312)

* Update tooling

* Run gofumpt

* go mod vendor
This commit is contained in:
Brian Kassouf
2021-04-08 09:43:39 -07:00
committed by GitHub
parent 60f3ba99a4
commit a24653cc5c
658 changed files with 10961 additions and 3671 deletions

View File

@@ -17,7 +17,7 @@ func TestFieldDataGet(t *testing.T) {
}{
"string type, string value": {
map[string]*FieldSchema{
"foo": &FieldSchema{Type: TypeString},
"foo": {Type: TypeString},
},
map[string]interface{}{
"foo": "bar",
@@ -29,7 +29,7 @@ func TestFieldDataGet(t *testing.T) {
"string type, int value": {
map[string]*FieldSchema{
"foo": &FieldSchema{Type: TypeString},
"foo": {Type: TypeString},
},
map[string]interface{}{
"foo": 42,
@@ -41,7 +41,7 @@ func TestFieldDataGet(t *testing.T) {
"string type, unset value": {
map[string]*FieldSchema{
"foo": &FieldSchema{Type: TypeString},
"foo": {Type: TypeString},
},
map[string]interface{}{},
"foo",
@@ -51,7 +51,7 @@ func TestFieldDataGet(t *testing.T) {
"string type, unset value with default": {
map[string]*FieldSchema{
"foo": &FieldSchema{
"foo": {
Type: TypeString,
Default: "bar",
},
@@ -64,7 +64,7 @@ func TestFieldDataGet(t *testing.T) {
"lowercase string type, lowercase string value": {
map[string]*FieldSchema{
"foo": &FieldSchema{Type: TypeLowerCaseString},
"foo": {Type: TypeLowerCaseString},
},
map[string]interface{}{
"foo": "bar",
@@ -76,7 +76,7 @@ func TestFieldDataGet(t *testing.T) {
"lowercase string type, mixed-case string value": {
map[string]*FieldSchema{
"foo": &FieldSchema{Type: TypeLowerCaseString},
"foo": {Type: TypeLowerCaseString},
},
map[string]interface{}{
"foo": "BaR",
@@ -88,7 +88,7 @@ func TestFieldDataGet(t *testing.T) {
"lowercase string type, int value": {
map[string]*FieldSchema{
"foo": &FieldSchema{Type: TypeLowerCaseString},
"foo": {Type: TypeLowerCaseString},
},
map[string]interface{}{
"foo": 42,
@@ -100,7 +100,7 @@ func TestFieldDataGet(t *testing.T) {
"lowercase string type, unset value": {
map[string]*FieldSchema{
"foo": &FieldSchema{Type: TypeLowerCaseString},
"foo": {Type: TypeLowerCaseString},
},
map[string]interface{}{},
"foo",
@@ -110,7 +110,7 @@ func TestFieldDataGet(t *testing.T) {
"lowercase string type, unset value with lowercase default": {
map[string]*FieldSchema{
"foo": &FieldSchema{
"foo": {
Type: TypeLowerCaseString,
Default: "bar",
},
@@ -123,7 +123,7 @@ func TestFieldDataGet(t *testing.T) {
"int type, int value": {
map[string]*FieldSchema{
"foo": &FieldSchema{Type: TypeInt},
"foo": {Type: TypeInt},
},
map[string]interface{}{
"foo": 42,
@@ -135,7 +135,7 @@ func TestFieldDataGet(t *testing.T) {
"bool type, bool value": {
map[string]*FieldSchema{
"foo": &FieldSchema{Type: TypeBool},
"foo": {Type: TypeBool},
},
map[string]interface{}{
"foo": false,
@@ -147,7 +147,7 @@ func TestFieldDataGet(t *testing.T) {
"map type, map value": {
map[string]*FieldSchema{
"foo": &FieldSchema{Type: TypeMap},
"foo": {Type: TypeMap},
},
map[string]interface{}{
"foo": map[string]interface{}{
@@ -163,7 +163,7 @@ func TestFieldDataGet(t *testing.T) {
"duration type, string value": {
map[string]*FieldSchema{
"foo": &FieldSchema{Type: TypeDurationSecond},
"foo": {Type: TypeDurationSecond},
},
map[string]interface{}{
"foo": "42",
@@ -175,7 +175,7 @@ func TestFieldDataGet(t *testing.T) {
"duration type, string duration value": {
map[string]*FieldSchema{
"foo": &FieldSchema{Type: TypeDurationSecond},
"foo": {Type: TypeDurationSecond},
},
map[string]interface{}{
"foo": "42m",
@@ -187,7 +187,7 @@ func TestFieldDataGet(t *testing.T) {
"duration type, int value": {
map[string]*FieldSchema{
"foo": &FieldSchema{Type: TypeDurationSecond},
"foo": {Type: TypeDurationSecond},
},
map[string]interface{}{
"foo": 42,
@@ -199,7 +199,7 @@ func TestFieldDataGet(t *testing.T) {
"duration type, float value": {
map[string]*FieldSchema{
"foo": &FieldSchema{Type: TypeDurationSecond},
"foo": {Type: TypeDurationSecond},
},
map[string]interface{}{
"foo": 42.0,
@@ -211,7 +211,7 @@ func TestFieldDataGet(t *testing.T) {
"duration type, nil value": {
map[string]*FieldSchema{
"foo": &FieldSchema{Type: TypeDurationSecond},
"foo": {Type: TypeDurationSecond},
},
map[string]interface{}{
"foo": nil,
@@ -223,7 +223,7 @@ func TestFieldDataGet(t *testing.T) {
"duration type, 0 value": {
map[string]*FieldSchema{
"foo": &FieldSchema{Type: TypeDurationSecond},
"foo": {Type: TypeDurationSecond},
},
map[string]interface{}{
"foo": 0,
@@ -235,7 +235,7 @@ func TestFieldDataGet(t *testing.T) {
"signed duration type, positive string value": {
map[string]*FieldSchema{
"foo": &FieldSchema{Type: TypeSignedDurationSecond},
"foo": {Type: TypeSignedDurationSecond},
},
map[string]interface{}{
"foo": "42",
@@ -247,7 +247,7 @@ func TestFieldDataGet(t *testing.T) {
"signed duration type, positive string duration value": {
map[string]*FieldSchema{
"foo": &FieldSchema{Type: TypeSignedDurationSecond},
"foo": {Type: TypeSignedDurationSecond},
},
map[string]interface{}{
"foo": "42m",
@@ -259,7 +259,7 @@ func TestFieldDataGet(t *testing.T) {
"signed duration type, positive int value": {
map[string]*FieldSchema{
"foo": &FieldSchema{Type: TypeSignedDurationSecond},
"foo": {Type: TypeSignedDurationSecond},
},
map[string]interface{}{
"foo": 42,
@@ -271,7 +271,7 @@ func TestFieldDataGet(t *testing.T) {
"signed duration type, positive float value": {
map[string]*FieldSchema{
"foo": &FieldSchema{Type: TypeSignedDurationSecond},
"foo": {Type: TypeSignedDurationSecond},
},
map[string]interface{}{
"foo": 42.0,
@@ -283,7 +283,7 @@ func TestFieldDataGet(t *testing.T) {
"signed duration type, negative string value": {
map[string]*FieldSchema{
"foo": &FieldSchema{Type: TypeSignedDurationSecond},
"foo": {Type: TypeSignedDurationSecond},
},
map[string]interface{}{
"foo": "-42",
@@ -295,7 +295,7 @@ func TestFieldDataGet(t *testing.T) {
"signed duration type, negative string duration value": {
map[string]*FieldSchema{
"foo": &FieldSchema{Type: TypeSignedDurationSecond},
"foo": {Type: TypeSignedDurationSecond},
},
map[string]interface{}{
"foo": "-42m",
@@ -307,7 +307,7 @@ func TestFieldDataGet(t *testing.T) {
"signed duration type, negative int value": {
map[string]*FieldSchema{
"foo": &FieldSchema{Type: TypeSignedDurationSecond},
"foo": {Type: TypeSignedDurationSecond},
},
map[string]interface{}{
"foo": -42,
@@ -319,7 +319,7 @@ func TestFieldDataGet(t *testing.T) {
"signed duration type, negative float value": {
map[string]*FieldSchema{
"foo": &FieldSchema{Type: TypeSignedDurationSecond},
"foo": {Type: TypeSignedDurationSecond},
},
map[string]interface{}{
"foo": -42.0,
@@ -331,7 +331,7 @@ func TestFieldDataGet(t *testing.T) {
"signed duration type, nil value": {
map[string]*FieldSchema{
"foo": &FieldSchema{Type: TypeSignedDurationSecond},
"foo": {Type: TypeSignedDurationSecond},
},
map[string]interface{}{
"foo": nil,
@@ -343,7 +343,7 @@ func TestFieldDataGet(t *testing.T) {
"signed duration type, 0 value": {
map[string]*FieldSchema{
"foo": &FieldSchema{Type: TypeSignedDurationSecond},
"foo": {Type: TypeSignedDurationSecond},
},
map[string]interface{}{
"foo": 0,
@@ -355,7 +355,7 @@ func TestFieldDataGet(t *testing.T) {
"slice type, empty slice": {
map[string]*FieldSchema{
"foo": &FieldSchema{Type: TypeSlice},
"foo": {Type: TypeSlice},
},
map[string]interface{}{
"foo": []interface{}{},
@@ -367,7 +367,7 @@ func TestFieldDataGet(t *testing.T) {
"slice type, filled, mixed slice": {
map[string]*FieldSchema{
"foo": &FieldSchema{Type: TypeSlice},
"foo": {Type: TypeSlice},
},
map[string]interface{}{
"foo": []interface{}{123, "abc"},
@@ -379,7 +379,7 @@ func TestFieldDataGet(t *testing.T) {
"string slice type, filled slice": {
map[string]*FieldSchema{
"foo": &FieldSchema{Type: TypeStringSlice},
"foo": {Type: TypeStringSlice},
},
map[string]interface{}{
"foo": []interface{}{123, "abc"},
@@ -391,7 +391,7 @@ func TestFieldDataGet(t *testing.T) {
"string slice type, single value": {
map[string]*FieldSchema{
"foo": &FieldSchema{Type: TypeStringSlice},
"foo": {Type: TypeStringSlice},
},
map[string]interface{}{
"foo": "abc",
@@ -403,7 +403,7 @@ func TestFieldDataGet(t *testing.T) {
"string slice type, empty string": {
map[string]*FieldSchema{
"foo": &FieldSchema{Type: TypeStringSlice},
"foo": {Type: TypeStringSlice},
},
map[string]interface{}{
"foo": "",
@@ -415,7 +415,7 @@ func TestFieldDataGet(t *testing.T) {
"comma string slice type, empty string": {
map[string]*FieldSchema{
"foo": &FieldSchema{Type: TypeCommaStringSlice},
"foo": {Type: TypeCommaStringSlice},
},
map[string]interface{}{
"foo": "",
@@ -427,7 +427,7 @@ func TestFieldDataGet(t *testing.T) {
"comma string slice type, comma string with one value": {
map[string]*FieldSchema{
"foo": &FieldSchema{Type: TypeCommaStringSlice},
"foo": {Type: TypeCommaStringSlice},
},
map[string]interface{}{
"foo": "value1",
@@ -439,7 +439,7 @@ func TestFieldDataGet(t *testing.T) {
"comma string slice type, comma string with multi value": {
map[string]*FieldSchema{
"foo": &FieldSchema{Type: TypeCommaStringSlice},
"foo": {Type: TypeCommaStringSlice},
},
map[string]interface{}{
"foo": "value1,value2,value3",
@@ -451,7 +451,7 @@ func TestFieldDataGet(t *testing.T) {
"comma string slice type, nil string slice value": {
map[string]*FieldSchema{
"foo": &FieldSchema{Type: TypeCommaStringSlice},
"foo": {Type: TypeCommaStringSlice},
},
map[string]interface{}{
"foo": "",
@@ -463,7 +463,7 @@ func TestFieldDataGet(t *testing.T) {
"comma string slice type, string slice with one value": {
map[string]*FieldSchema{
"foo": &FieldSchema{Type: TypeCommaStringSlice},
"foo": {Type: TypeCommaStringSlice},
},
map[string]interface{}{
"foo": []interface{}{"value1"},
@@ -475,7 +475,7 @@ func TestFieldDataGet(t *testing.T) {
"comma string slice type, string slice with multi value": {
map[string]*FieldSchema{
"foo": &FieldSchema{Type: TypeCommaStringSlice},
"foo": {Type: TypeCommaStringSlice},
},
map[string]interface{}{
"foo": []interface{}{"value1", "value2", "value3"},
@@ -487,7 +487,7 @@ func TestFieldDataGet(t *testing.T) {
"comma string slice type, empty string slice value": {
map[string]*FieldSchema{
"foo": &FieldSchema{Type: TypeCommaStringSlice},
"foo": {Type: TypeCommaStringSlice},
},
map[string]interface{}{
"foo": []interface{}{},
@@ -499,7 +499,7 @@ func TestFieldDataGet(t *testing.T) {
"comma int slice type, comma int with one value": {
map[string]*FieldSchema{
"foo": &FieldSchema{Type: TypeCommaIntSlice},
"foo": {Type: TypeCommaIntSlice},
},
map[string]interface{}{
"foo": 1,
@@ -511,7 +511,7 @@ func TestFieldDataGet(t *testing.T) {
"comma int slice type, comma int with multi value slice": {
map[string]*FieldSchema{
"foo": &FieldSchema{Type: TypeCommaIntSlice},
"foo": {Type: TypeCommaIntSlice},
},
map[string]interface{}{
"foo": []int{1, 2, 3},
@@ -523,7 +523,7 @@ func TestFieldDataGet(t *testing.T) {
"comma int slice type, comma int with multi value": {
map[string]*FieldSchema{
"foo": &FieldSchema{Type: TypeCommaIntSlice},
"foo": {Type: TypeCommaIntSlice},
},
map[string]interface{}{
"foo": "1,2,3",
@@ -535,7 +535,7 @@ func TestFieldDataGet(t *testing.T) {
"comma int slice type, nil int slice value": {
map[string]*FieldSchema{
"foo": &FieldSchema{Type: TypeCommaIntSlice},
"foo": {Type: TypeCommaIntSlice},
},
map[string]interface{}{
"foo": "",
@@ -547,7 +547,7 @@ func TestFieldDataGet(t *testing.T) {
"comma int slice type, int slice with one value": {
map[string]*FieldSchema{
"foo": &FieldSchema{Type: TypeCommaIntSlice},
"foo": {Type: TypeCommaIntSlice},
},
map[string]interface{}{
"foo": []interface{}{"1"},
@@ -559,7 +559,7 @@ func TestFieldDataGet(t *testing.T) {
"comma int slice type, int slice with multi value strings": {
map[string]*FieldSchema{
"foo": &FieldSchema{Type: TypeCommaIntSlice},
"foo": {Type: TypeCommaIntSlice},
},
map[string]interface{}{
"foo": []interface{}{"1", "2", "3"},
@@ -571,7 +571,7 @@ func TestFieldDataGet(t *testing.T) {
"comma int slice type, int slice with multi value": {
map[string]*FieldSchema{
"foo": &FieldSchema{Type: TypeCommaIntSlice},
"foo": {Type: TypeCommaIntSlice},
},
map[string]interface{}{
"foo": []interface{}{1, 2, 3},
@@ -583,7 +583,7 @@ func TestFieldDataGet(t *testing.T) {
"comma int slice type, empty int slice value": {
map[string]*FieldSchema{
"foo": &FieldSchema{Type: TypeCommaIntSlice},
"foo": {Type: TypeCommaIntSlice},
},
map[string]interface{}{
"foo": []interface{}{},
@@ -594,7 +594,7 @@ func TestFieldDataGet(t *testing.T) {
},
"name string type, valid string": {
map[string]*FieldSchema{
"foo": &FieldSchema{Type: TypeNameString},
"foo": {Type: TypeNameString},
},
map[string]interface{}{
"foo": "bar",
@@ -606,7 +606,7 @@ func TestFieldDataGet(t *testing.T) {
"name string type, valid value with special characters": {
map[string]*FieldSchema{
"foo": &FieldSchema{Type: TypeNameString},
"foo": {Type: TypeNameString},
},
map[string]interface{}{
"foo": "bar.baz-bay123",
@@ -618,7 +618,7 @@ func TestFieldDataGet(t *testing.T) {
"keypair type, valid value map type": {
map[string]*FieldSchema{
"foo": &FieldSchema{Type: TypeKVPairs},
"foo": {Type: TypeKVPairs},
},
map[string]interface{}{
"foo": map[string]interface{}{
@@ -638,7 +638,7 @@ func TestFieldDataGet(t *testing.T) {
"keypair type, list of equal sign delim key pairs type": {
map[string]*FieldSchema{
"foo": &FieldSchema{Type: TypeKVPairs},
"foo": {Type: TypeKVPairs},
},
map[string]interface{}{
"foo": []interface{}{"key1=value1", "key2=value2", "key3=1"},
@@ -654,7 +654,7 @@ func TestFieldDataGet(t *testing.T) {
"keypair type, single equal sign delim value": {
map[string]*FieldSchema{
"foo": &FieldSchema{Type: TypeKVPairs},
"foo": {Type: TypeKVPairs},
},
map[string]interface{}{
"foo": "key1=value1",
@@ -1005,7 +1005,7 @@ func TestFieldDataGet_Error(t *testing.T) {
}{
"name string type, invalid value with invalid characters": {
map[string]*FieldSchema{
"foo": &FieldSchema{Type: TypeNameString},
"foo": {Type: TypeNameString},
},
map[string]interface{}{
"foo": "bar baz",
@@ -1014,7 +1014,7 @@ func TestFieldDataGet_Error(t *testing.T) {
},
"name string type, invalid value with special characters at beginning": {
map[string]*FieldSchema{
"foo": &FieldSchema{Type: TypeNameString},
"foo": {Type: TypeNameString},
},
map[string]interface{}{
"foo": ".barbaz",
@@ -1023,7 +1023,7 @@ func TestFieldDataGet_Error(t *testing.T) {
},
"name string type, invalid value with special characters at end": {
map[string]*FieldSchema{
"foo": &FieldSchema{Type: TypeNameString},
"foo": {Type: TypeNameString},
},
map[string]interface{}{
"foo": "barbaz-",
@@ -1032,7 +1032,7 @@ func TestFieldDataGet_Error(t *testing.T) {
},
"name string type, empty string": {
map[string]*FieldSchema{
"foo": &FieldSchema{Type: TypeNameString},
"foo": {Type: TypeNameString},
},
map[string]interface{}{
"foo": "",
@@ -1041,7 +1041,7 @@ func TestFieldDataGet_Error(t *testing.T) {
},
"keypair type, csv version empty key name": {
map[string]*FieldSchema{
"foo": &FieldSchema{Type: TypeKVPairs},
"foo": {Type: TypeKVPairs},
},
map[string]interface{}{
"foo": []interface{}{"=value1", "key2=value2", "key3=1"},
@@ -1050,7 +1050,7 @@ func TestFieldDataGet_Error(t *testing.T) {
},
"duration type, negative string value": {
map[string]*FieldSchema{
"foo": &FieldSchema{Type: TypeDurationSecond},
"foo": {Type: TypeDurationSecond},
},
map[string]interface{}{
"foo": "-42",
@@ -1059,7 +1059,7 @@ func TestFieldDataGet_Error(t *testing.T) {
},
"duration type, negative string duration value": {
map[string]*FieldSchema{
"foo": &FieldSchema{Type: TypeDurationSecond},
"foo": {Type: TypeDurationSecond},
},
map[string]interface{}{
"foo": "-42m",
@@ -1068,7 +1068,7 @@ func TestFieldDataGet_Error(t *testing.T) {
},
"duration type, negative int value": {
map[string]*FieldSchema{
"foo": &FieldSchema{Type: TypeDurationSecond},
"foo": {Type: TypeDurationSecond},
},
map[string]interface{}{
"foo": -42,
@@ -1077,7 +1077,7 @@ func TestFieldDataGet_Error(t *testing.T) {
},
"duration type, negative float value": {
map[string]*FieldSchema{
"foo": &FieldSchema{Type: TypeDurationSecond},
"foo": {Type: TypeDurationSecond},
},
map[string]interface{}{
"foo": -42.0,