Skip to content

Commit 0e4b18c

Browse files
committed
correct misspellings, gofmt
1 parent 909ca9f commit 0e4b18c

19 files changed

+269
-269
lines changed

abstract_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -405,7 +405,7 @@ func TestResolveTypeOnInterfaceYieldsUsefulError(t *testing.T) {
405405
},
406406
},
407407
Errors: []gqlerrors.FormattedError{
408-
gqlerrors.FormattedError{
408+
{
409409
Message: `Runtime Object type "Human" is not a possible type for "Pet".`,
410410
Locations: []location.SourceLocation{},
411411
},
@@ -523,7 +523,7 @@ func TestResolveTypeOnUnionYieldsUsefulError(t *testing.T) {
523523
},
524524
},
525525
Errors: []gqlerrors.FormattedError{
526-
gqlerrors.FormattedError{
526+
{
527527
Message: `Runtime Object type "Human" is not a possible type for "Pet".`,
528528
Locations: []location.SourceLocation{},
529529
},

definition_test.go

Lines changed: 23 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -366,17 +366,17 @@ func TestTypeSystem_DefinitionExample_StringifiesSimpleTypes(t *testing.T) {
366366
expected string
367367
}
368368
tests := []Test{
369-
Test{graphql.Int, "Int"},
370-
Test{blogArticle, "Article"},
371-
Test{interfaceType, "Interface"},
372-
Test{unionType, "Union"},
373-
Test{enumType, "Enum"},
374-
Test{inputObjectType, "InputObject"},
375-
Test{graphql.NewNonNull(graphql.Int), "Int!"},
376-
Test{graphql.NewList(graphql.Int), "[Int]"},
377-
Test{graphql.NewNonNull(graphql.NewList(graphql.Int)), "[Int]!"},
378-
Test{graphql.NewList(graphql.NewNonNull(graphql.Int)), "[Int!]"},
379-
Test{graphql.NewList(graphql.NewList(graphql.Int)), "[[Int]]"},
369+
{graphql.Int, "Int"},
370+
{blogArticle, "Article"},
371+
{interfaceType, "Interface"},
372+
{unionType, "Union"},
373+
{enumType, "Enum"},
374+
{inputObjectType, "InputObject"},
375+
{graphql.NewNonNull(graphql.Int), "Int!"},
376+
{graphql.NewList(graphql.Int), "[Int]"},
377+
{graphql.NewNonNull(graphql.NewList(graphql.Int)), "[Int]!"},
378+
{graphql.NewList(graphql.NewNonNull(graphql.Int)), "[Int!]"},
379+
{graphql.NewList(graphql.NewList(graphql.Int)), "[[Int]]"},
380380
}
381381
for _, test := range tests {
382382
ttypeStr := fmt.Sprintf("%v", test.ttype)
@@ -392,12 +392,12 @@ func TestTypeSystem_DefinitionExample_IdentifiesInputTypes(t *testing.T) {
392392
expected bool
393393
}
394394
tests := []Test{
395-
Test{graphql.Int, true},
396-
Test{objectType, false},
397-
Test{interfaceType, false},
398-
Test{unionType, false},
399-
Test{enumType, true},
400-
Test{inputObjectType, true},
395+
{graphql.Int, true},
396+
{objectType, false},
397+
{interfaceType, false},
398+
{unionType, false},
399+
{enumType, true},
400+
{inputObjectType, true},
401401
}
402402
for _, test := range tests {
403403
ttypeStr := fmt.Sprintf("%v", test.ttype)
@@ -419,12 +419,12 @@ func TestTypeSystem_DefinitionExample_IdentifiesOutputTypes(t *testing.T) {
419419
expected bool
420420
}
421421
tests := []Test{
422-
Test{graphql.Int, true},
423-
Test{objectType, true},
424-
Test{interfaceType, true},
425-
Test{unionType, true},
426-
Test{enumType, true},
427-
Test{inputObjectType, false},
422+
{graphql.Int, true},
423+
{objectType, true},
424+
{interfaceType, true},
425+
{unionType, true},
426+
{enumType, true},
427+
{inputObjectType, false},
428428
}
429429
for _, test := range tests {
430430
ttypeStr := fmt.Sprintf("%v", test.ttype)

directives.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ var IncludeDirective *Directive = NewDirective(&Directive{
3535
Description: "Directs the executor to include this field or fragment only when " +
3636
"the `if` argument is true.",
3737
Args: []*Argument{
38-
&Argument{
38+
{
3939
PrivateName: "if",
4040
Type: NewNonNull(Boolean),
4141
PrivateDescription: "Included when true.",
@@ -54,7 +54,7 @@ var SkipDirective *Directive = NewDirective(&Directive{
5454
Description: "Directs the executor to skip this field or fragment when the `if` " +
5555
"argument is true.",
5656
Args: []*Argument{
57-
&Argument{
57+
{
5858
PrivateName: "if",
5959
Type: NewNonNull(Boolean),
6060
PrivateDescription: "Skipped when true.",

enum_type_test.go

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -155,7 +155,7 @@ func TestTypeSystem_EnumValues_DoesNotAcceptStringLiterals(t *testing.T) {
155155
expected := &graphql.Result{
156156
Data: nil,
157157
Errors: []gqlerrors.FormattedError{
158-
gqlerrors.FormattedError{
158+
{
159159
Message: `Argument "fromEnum" expected type "Color" but got: "GREEN".`,
160160
},
161161
},
@@ -182,7 +182,7 @@ func TestTypeSystem_EnumValues_DoesNotAcceptInternalValueInPlaceOfEnumLiteral(t
182182
expected := &graphql.Result{
183183
Data: nil,
184184
Errors: []gqlerrors.FormattedError{
185-
gqlerrors.FormattedError{
185+
{
186186
Message: `Argument "fromEnum" expected type "Color" but got: 1.`,
187187
},
188188
},
@@ -198,7 +198,7 @@ func TestTypeSystem_EnumValues_DoesNotAcceptEnumLiteralInPlaceOfInt(t *testing.T
198198
expected := &graphql.Result{
199199
Data: nil,
200200
Errors: []gqlerrors.FormattedError{
201-
gqlerrors.FormattedError{
201+
{
202202
Message: `Argument "fromInt" expected type "Int" but got: GREEN.`,
203203
},
204204
},
@@ -248,7 +248,7 @@ func TestTypeSystem_EnumValues_DoesNotAcceptInternalValueAsEnumVariable(t *testi
248248
expected := &graphql.Result{
249249
Data: nil,
250250
Errors: []gqlerrors.FormattedError{
251-
gqlerrors.FormattedError{
251+
{
252252
Message: `Variable "$color" expected value of type "Color!" but got: 2.`,
253253
},
254254
},
@@ -266,7 +266,7 @@ func TestTypeSystem_EnumValues_DoesNotAcceptStringVariablesAsEnumInput(t *testin
266266
expected := &graphql.Result{
267267
Data: nil,
268268
Errors: []gqlerrors.FormattedError{
269-
gqlerrors.FormattedError{
269+
{
270270
Message: `Variable "$color" of type "String!" used in position expecting type "Color".`,
271271
},
272272
},
@@ -284,7 +284,7 @@ func TestTypeSystem_EnumValues_DoesNotAcceptInternalValueVariableAsEnumInput(t *
284284
expected := &graphql.Result{
285285
Data: nil,
286286
Errors: []gqlerrors.FormattedError{
287-
gqlerrors.FormattedError{
287+
{
288288
Message: `Variable "$color" of type "Int!" used in position expecting type "Color".`,
289289
},
290290
},

executor.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ func buildExecutionContext(p BuildExecutionCtxParams) (*ExecutionContext, error)
110110
opName := p.OperationName
111111
if opName == "" {
112112
// get first opName
113-
for k, _ := range operations {
113+
for k := range operations {
114114
opName = k
115115
break
116116
}
@@ -397,10 +397,10 @@ func doesFragmentConditionMatch(eCtx *ExecutionContext, fragment ast.Node, ttype
397397
if conditionalType == ttype {
398398
return true
399399
}
400-
if conditionalType.Name() == ttype.Name() {
400+
if conditionalType.Name() == ttype.Name() {
401401
return true
402402
}
403-
403+
404404
if conditionalType, ok := conditionalType.(Abstract); ok {
405405
return conditionalType.IsPossibleType(ttype)
406406
}
@@ -739,7 +739,7 @@ func defaultResolveFn(p ResolveParams) (interface{}, error) {
739739
}
740740

741741
/**
742-
* This method looks up the field on the given type defintion.
742+
* This method looks up the field on the given type definition.
743743
* It has special casing for the two introspection fields, __schema
744744
* and __typename. __typename is special because it can always be
745745
* queried as a field, even in situations where no other fields

executor_test.go

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -465,10 +465,10 @@ func TestNullsOutErrorSubtrees(t *testing.T) {
465465
"syncError": nil,
466466
}
467467
expectedErrors := []gqlerrors.FormattedError{
468-
gqlerrors.FormattedError{
468+
{
469469
Message: "Error getting syncError",
470470
Locations: []location.SourceLocation{
471-
location.SourceLocation{
471+
{
472472
Line: 3, Column: 7,
473473
},
474474
},
@@ -619,7 +619,7 @@ func TestThrowsIfNoOperationIsProvidedWithMultipleOperations(t *testing.T) {
619619
}
620620

621621
expectedErrors := []gqlerrors.FormattedError{
622-
gqlerrors.FormattedError{
622+
{
623623
Message: "Must provide operation name if query contains multiple operations.",
624624
Locations: []location.SourceLocation{},
625625
},
@@ -1050,7 +1050,7 @@ func TestFailsWhenAnIsTypeOfCheckIsNotMet(t *testing.T) {
10501050
},
10511051
},
10521052
Errors: []gqlerrors.FormattedError{
1053-
gqlerrors.FormattedError{
1053+
{
10541054
Message: `Expected value of type "SpecialType" but got: graphql_test.testNotSpecialType.`,
10551055
Locations: []location.SourceLocation{},
10561056
},
@@ -1119,7 +1119,7 @@ func TestFailsToExecuteQueryContainingATypeDefinition(t *testing.T) {
11191119
expected := &graphql.Result{
11201120
Data: nil,
11211121
Errors: []gqlerrors.FormattedError{
1122-
gqlerrors.FormattedError{
1122+
{
11231123
Message: "GraphQL cannot execute a request containing a ObjectDefinition",
11241124
Locations: []location.SourceLocation{},
11251125
},

graphql_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ var Tests = []T{}
1919

2020
func init() {
2121
Tests = []T{
22-
T{
22+
{
2323
Query: `
2424
query HeroNameQuery {
2525
hero {
@@ -36,7 +36,7 @@ func init() {
3636
},
3737
},
3838
},
39-
T{
39+
{
4040
Query: `
4141
query HeroNameAndFriendsQuery {
4242
hero {

introspection.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -440,7 +440,7 @@ mutation operations.`,
440440
Type: __Type,
441441
Description: "Request the type information of a single type.",
442442
Args: []*Argument{
443-
&Argument{
443+
{
444444
PrivateName: "name",
445445
Type: NewNonNull(String),
446446
},

introspection_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1211,11 +1211,11 @@ func TestIntrospection_FailsAsExpectedOnThe__TypeRootFieldWithoutAnArg(t *testin
12111211
`
12121212
expected := &graphql.Result{
12131213
Errors: []gqlerrors.FormattedError{
1214-
gqlerrors.FormattedError{
1214+
{
12151215
Message: `Field "__type" argument "name" of type "String!" ` +
12161216
`is required but not provided.`,
12171217
Locations: []location.SourceLocation{
1218-
location.SourceLocation{Line: 3, Column: 9},
1218+
{Line: 3, Column: 9},
12191219
},
12201220
},
12211221
},

0 commit comments

Comments
 (0)