Skip to content

Commit

Permalink
Merge pull request #176 from graphql-go/gofmt-s
Browse files Browse the repository at this point in the history
gofmt -s
  • Loading branch information
chris-ramon authored Dec 10, 2016
2 parents 5d28c3f + f8ec35c commit 22050ee
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 14 deletions.
8 changes: 4 additions & 4 deletions language/visitor/visitor_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ func TestVisitor_AllowsEditingANodeBothOnEnterAndOnLeave(t *testing.T) {
v := &visitor.VisitorOptions{

KindFuncMap: map[string]visitor.NamedVisitFuncs{
kinds.OperationDefinition: visitor.NamedVisitFuncs{
kinds.OperationDefinition: {
Enter: func(p visitor.VisitFuncParams) (string, interface{}) {
if node, ok := p.Node.(*ast.OperationDefinition); ok {
selectionSet = node.SelectionSet
Expand Down Expand Up @@ -120,7 +120,7 @@ func TestVisitor_AllowsEditingTheRootNodeOnEnterAndOnLeave(t *testing.T) {
v := &visitor.VisitorOptions{

KindFuncMap: map[string]visitor.NamedVisitFuncs{
kinds.Document: visitor.NamedVisitFuncs{
kinds.Document: {
Enter: func(p visitor.VisitFuncParams) (string, interface{}) {
if node, ok := p.Node.(*ast.Document); ok {
visited["didEnter"] = true
Expand Down Expand Up @@ -931,7 +931,7 @@ func TestVisitor_VisitInParallel_AllowsSkippingDifferentSubTrees(t *testing.T) {
}

v := []*visitor.VisitorOptions{
&visitor.VisitorOptions{
{
Enter: func(p visitor.VisitFuncParams) (string, interface{}) {
switch node := p.Node.(type) {
case *ast.Name:
Expand Down Expand Up @@ -960,7 +960,7 @@ func TestVisitor_VisitInParallel_AllowsSkippingDifferentSubTrees(t *testing.T) {
return visitor.ActionNoChange, nil
},
},
&visitor.VisitorOptions{
{
Enter: func(p visitor.VisitFuncParams) (string, interface{}) {
switch node := p.Node.(type) {
case *ast.Name:
Expand Down
14 changes: 7 additions & 7 deletions rules.go
Original file line number Diff line number Diff line change
Expand Up @@ -146,12 +146,12 @@ func DefaultValuesOfCorrectTypeRule(context *ValidationContext) *ValidationRuleI
return visitor.ActionSkip, nil
},
},
kinds.SelectionSet: visitor.NamedVisitFuncs{
kinds.SelectionSet: {
Kind: func(p visitor.VisitFuncParams) (string, interface{}) {
return visitor.ActionSkip, nil
},
},
kinds.FragmentDefinition: visitor.NamedVisitFuncs{
kinds.FragmentDefinition: {
Kind: func(p visitor.VisitFuncParams) (string, interface{}) {
return visitor.ActionSkip, nil
},
Expand Down Expand Up @@ -1875,7 +1875,7 @@ func UniqueInputFieldNamesRule(context *ValidationContext) *ValidationRuleInstan

visitorOpts := &visitor.VisitorOptions{
KindFuncMap: map[string]visitor.NamedVisitFuncs{
kinds.ObjectValue: visitor.NamedVisitFuncs{
kinds.ObjectValue: {
Enter: func(p visitor.VisitFuncParams) (string, interface{}) {
knownNameStack = append(knownNameStack, knownNames)
knownNames = map[string]*ast.Name{}
Expand All @@ -1887,7 +1887,7 @@ func UniqueInputFieldNamesRule(context *ValidationContext) *ValidationRuleInstan
return visitor.ActionNoChange, nil
},
},
kinds.ObjectField: visitor.NamedVisitFuncs{
kinds.ObjectField: {
Kind: func(p visitor.VisitFuncParams) (string, interface{}) {
if node, ok := p.Node.(*ast.ObjectField); ok {
fieldName := ""
Expand Down Expand Up @@ -1943,7 +1943,7 @@ func UniqueOperationNamesRule(context *ValidationContext) *ValidationRuleInstanc
return visitor.ActionSkip, nil
},
},
kinds.FragmentDefinition: visitor.NamedVisitFuncs{
kinds.FragmentDefinition: {
Kind: func(p visitor.VisitFuncParams) (string, interface{}) {
return visitor.ActionSkip, nil
},
Expand All @@ -1963,15 +1963,15 @@ func UniqueVariableNamesRule(context *ValidationContext) *ValidationRuleInstance

visitorOpts := &visitor.VisitorOptions{
KindFuncMap: map[string]visitor.NamedVisitFuncs{
kinds.OperationDefinition: visitor.NamedVisitFuncs{
kinds.OperationDefinition: {
Kind: func(p visitor.VisitFuncParams) (string, interface{}) {
if node, ok := p.Node.(*ast.OperationDefinition); ok && node != nil {
knownVariableNames = map[string]*ast.Name{}
}
return visitor.ActionNoChange, nil
},
},
kinds.VariableDefinition: visitor.NamedVisitFuncs{
kinds.VariableDefinition: {
Kind: func(p visitor.VisitFuncParams) (string, interface{}) {
if node, ok := p.Node.(*ast.VariableDefinition); ok && node != nil {
variableName := ""
Expand Down
4 changes: 2 additions & 2 deletions validator.go
Original file line number Diff line number Diff line change
Expand Up @@ -231,12 +231,12 @@ func (ctx *ValidationContext) VariableUsages(node HasSelectionSet) []*VariableUs

visitor.Visit(node, visitor.VisitWithTypeInfo(typeInfo, &visitor.VisitorOptions{
KindFuncMap: map[string]visitor.NamedVisitFuncs{
kinds.VariableDefinition: visitor.NamedVisitFuncs{
kinds.VariableDefinition: {
Kind: func(p visitor.VisitFuncParams) (string, interface{}) {
return visitor.ActionSkip, nil
},
},
kinds.Variable: visitor.NamedVisitFuncs{
kinds.Variable: {
Kind: func(p visitor.VisitFuncParams) (string, interface{}) {
if node, ok := p.Node.(*ast.Variable); ok && node != nil {
usages = append(usages, &VariableUsage{
Expand Down
2 changes: 1 addition & 1 deletion variables_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -533,7 +533,7 @@ func TestVariables_ObjectsAndNullability_UsingVariables_ErrorsOnDeepNestedErrors
"\nIn field \"na\": In field \"c\": Expected \"String!\", found null." +
"\nIn field \"nb\": Expected \"String!\", found null.",
Locations: []location.SourceLocation{
location.SourceLocation{
{
Line: 2, Column: 19,
},
},
Expand Down

0 comments on commit 22050ee

Please sign in to comment.