Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

(Federation) Is_Entity is unloved by golint #1032

Closed
carldunham opened this issue Feb 16, 2020 · 2 comments · Fixed by #1034
Closed

(Federation) Is_Entity is unloved by golint #1032

carldunham opened this issue Feb 16, 2020 · 2 comments · Fixed by #1034
Assignees

Comments

@carldunham
Copy link
Contributor

What happened?

On generated model file:

% golint company.go
company.go:12:16: don't use underscores in Go names; method Is_Entity should be IsEntity
% 

What did you expect?

% golint company.go
% 

Minimal graphql.schema and models to reproduce

schema:

type Company @extends @key(fields: "name") {
  name: String! @external
  moreStuff: [int]
}

versions

  • gqlgen version? v0.10.2-dev (commit 4ece385)
  • go version? go version go1.13.7 darwin/amd64
  • dep or go modules? modules
@BitPhinix
Copy link

A nice solution would be to do it like dig and providing a Entity struct which could be embedded into all entity structs.

Something like:

type Account struct {
	graphql.Entity
}

@carldunham
Copy link
Contributor Author

Wow, that was quick and way more throrough than what I expected. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants