Skip to content

Commit

Permalink
fix fmt anf metalint generated code
Browse files Browse the repository at this point in the history
  • Loading branch information
asamusev committed Dec 7, 2018
1 parent b32ebe1 commit 5e0456f
Show file tree
Hide file tree
Showing 14 changed files with 15 additions and 3 deletions.
2 changes: 1 addition & 1 deletion codegen/templates/data.go

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions codegen/templates/generated.gotpl
Original file line number Diff line number Diff line change
Expand Up @@ -287,6 +287,7 @@ var parsedSchema = gqlparser.MustLoadSchema(


// ChainFieldMiddleware add chain by FieldMiddleware
// nolint: deadcode
func chainFieldMiddleware(handleFunc ...graphql.FieldMiddleware) graphql.FieldMiddleware {
n := len(handleFunc)

Expand Down
3 changes: 2 additions & 1 deletion codegen/templates/templates.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ func Run(name string, tpldata interface{}) (*bytes.Buffer, error) {
"toCamel": ToCamel,
"dump": Dump,
"prefixLines": prefixLines,
"notNil": notNil,
"notNil": notNil,
"reserveImport": CurrentImports.Reserve,
"lookupImport": CurrentImports.Lookup,
})
Expand Down Expand Up @@ -116,6 +116,7 @@ func notNil(field string, data interface{}) bool {
return false
}
val := v.FieldByName(field)

return val.IsValid() && !val.IsNil()
}

Expand Down
1 change: 1 addition & 0 deletions codegen/testserver/generated.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion codegen/testserver/generated_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -217,7 +217,7 @@ func TestDirectives(t *testing.T) {
}
if message == nil {
err = errors.New("range invalid")
}else{
} else {
err = errors.New(*message)
}
if d, ok := obj.(int); ok {
Expand Down
1 change: 1 addition & 0 deletions example/chat/generated.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions example/config/generated.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions example/dataloader/generated.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions example/scalars/generated.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions example/selection/generated.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions example/starwars/generated.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions example/todo/generated.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions example/type-system-extension/generated.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions integration/generated.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 5e0456f

Please sign in to comment.