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

Collect generics into composed interface #61

Open
shaunc opened this issue Oct 28, 2019 · 2 comments
Open

Collect generics into composed interface #61

shaunc opened this issue Oct 28, 2019 · 2 comments

Comments

@shaunc
Copy link

shaunc commented Oct 28, 2019

I would like

//go:generate genny -in=$GOFILE -out=$GOFILE_gen gen "Datatype=string,int"

type Datatype generic.Type
type GetterDatatype interface {
  GetDataType(column string) (DataType, err)
}
type HasGetters interface {
  GetterDatatype
} 

To expand into

type GetterInt interface {
  GetInt(column string) (int, err)
}
type GetterString interface {
  GetString(column string) (string, err)
}
type HasGetters interface {
  GetterInt
  GetterString
}

But, of course, it doesn't. Is this a worthy enhancement? Is there a workaround to define HasGetters (other than knowing ahead of time what the datatypes are)?

@ghostsquad
Copy link
Contributor

What does it do right now?

@gemyago
Copy link

gemyago commented Jul 8, 2021

just duplicate entire file basically. Such a feature would be quite useful for me as well.

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

No branches or pull requests

3 participants