diff --git a/language/parser/parser.go b/language/parser/parser.go index 947b2a24..70c814d2 100644 --- a/language/parser/parser.go +++ b/language/parser/parser.go @@ -601,9 +601,7 @@ func parseValueLiteral(parser *Parser, isConst bool) (ast.Value, error) { Value: token.Value, Loc: loc(parser, token.Start), }), nil - case lexer.TokenKind[lexer.BLOCK_STRING]: - fallthrough - case lexer.TokenKind[lexer.STRING]: + case lexer.TokenKind[lexer.BLOCK_STRING], lexer.TokenKind[lexer.STRING]: return parseStringLiteral(parser) case lexer.TokenKind[lexer.NAME]: if token.Value == "true" || token.Value == "false" { diff --git a/type_info.go b/type_info.go index bcdc84a8..20c8886a 100644 --- a/type_info.go +++ b/type_info.go @@ -206,11 +206,7 @@ func (ti *TypeInfo) Leave(node ast.Node) { } case kinds.Directive: ti.directive = nil - case kinds.OperationDefinition: - fallthrough - case kinds.InlineFragment: - fallthrough - case kinds.FragmentDefinition: + case kinds.OperationDefinition, kinds.InlineFragment, kinds.FragmentDefinition: // pop ti.typeStack if len(ti.typeStack) > 0 { _, ti.typeStack = ti.typeStack[len(ti.typeStack)-1], ti.typeStack[:len(ti.typeStack)-1] @@ -226,9 +222,7 @@ func (ti *TypeInfo) Leave(node ast.Node) { if len(ti.inputTypeStack) > 0 { _, ti.inputTypeStack = ti.inputTypeStack[len(ti.inputTypeStack)-1], ti.inputTypeStack[:len(ti.inputTypeStack)-1] } - case kinds.ListValue: - fallthrough - case kinds.ObjectField: + case kinds.ListValue, kinds.ObjectField: // pop ti.inputTypeStack if len(ti.inputTypeStack) > 0 { _, ti.inputTypeStack = ti.inputTypeStack[len(ti.inputTypeStack)-1], ti.inputTypeStack[:len(ti.inputTypeStack)-1] diff --git a/util.go b/util.go index 1a887f0e..ea20f47c 100644 --- a/util.go +++ b/util.go @@ -75,17 +75,9 @@ func getGraphType(tipe reflect.Type) Output { switch kind { case reflect.String: return String - case reflect.Int: - fallthrough - case reflect.Int8: - fallthrough - case reflect.Int32: - fallthrough - case reflect.Int64: + case reflect.Int, reflect.Int8, reflect.Int32, reflect.Int64: return Int - case reflect.Float32: - fallthrough - case reflect.Float64: + case reflect.Float32, reflect.Float64: return Float case reflect.Bool: return Boolean @@ -98,19 +90,11 @@ func getGraphType(tipe reflect.Type) Output { func getGraphList(tipe reflect.Type) *List { if tipe.Kind() == reflect.Slice { switch tipe.Elem().Kind() { - case reflect.Int: - fallthrough - case reflect.Int8: - fallthrough - case reflect.Int32: - fallthrough - case reflect.Int64: + case reflect.Int, reflect.Int8, reflect.Int32, reflect.Int64: return NewList(Int) case reflect.Bool: return NewList(Boolean) - case reflect.Float32: - fallthrough - case reflect.Float64: + case reflect.Float32, reflect.Float64: return NewList(Float) case reflect.String: return NewList(String)