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

Allow code generation for primitive types #12

Closed
rickb777 opened this issue Jan 6, 2014 · 2 comments
Closed

Allow code generation for primitive types #12

rickb777 opened this issue Jan 6, 2014 · 2 comments

Comments

@rickb777
Copy link

rickb777 commented Jan 6, 2014

It would be nice to have an easy way to generate collections of strings, ints etc.

Even though there is only a small set of Go primitive types, generating the collections for them using gen would be a bit better than hand-coding because future developments of gen could be made use of with very little effort (just run gen again).

@clipperhouse
Copy link
Owner

Thanks, I’ve been thinking about this. This wouldn’t actually require codegen, it could just be an import, since it’s a finite set of known types. I’ll get to it after I’ve gotten the projection bits stable.

@clipperhouse
Copy link
Owner

@rickb777 The recent changes implement this, so long as it’s your type, along the lines of type MyType int.

Doing this in a general sense for all primitives would still require the creation of some sort of alias type, like type Ints []int.

For purposes of gen, I’m happy with the current approach but feel free to tell me about what you’d like a more general solution to look like, maybe it’s an idea for separate project.

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

2 participants