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

[WIP] First cut of support for multiple source files #17

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

myitcv
Copy link
Contributor

@myitcv myitcv commented Apr 28, 2017

Depends on #16; hence marking this as WIP until that is merged/resolved.

Allows source package to contain multiple .go files, but requires that exactly one file (the template) in that set contain a template "header":

// template type ...

(I have an immediate requirement for this; can easily work on multi-input multi-output as a follow up to this)

@ncw
Copy link
Owner

ncw commented May 3, 2017

This looks good! I've been meaning to do this for ages!

This produces a single output file for all the input as far as I can see. I think that is the right choice - no need to clutter the users directory with generated code.

The docs need updating too for this (remove the docs about the restriction and document that only one file can have the template type definitions)

Also we should probably make a new test which makes two input files.

@myitcv
Copy link
Contributor Author

myitcv commented May 3, 2017

Thanks for the feedback @ncw

As I mentioned my current scenario is where there are multiple input files but only one which forms the basis of the template (the others are the result of code generation applied to the template itself, something that's required for the template to compile)

So that's nice and simple because we can effectively ignore the files that do not contain the template "header", e.g.:

// template type Set(A)

Grouping files in a package by unique template "headers" would also be a way of having multiple templates per package (requirement being that a .go file contains at most one template header, else the package is in error)

The multi-input multi-output case is more complex for sure. That's not an immediate use case for me so I'm thinking through this case a bit more...

@ncw
Copy link
Owner

ncw commented May 7, 2017

#16 is merged now - can you rebase this and add some docs then I'll merge :-)

Thanks

@ncw
Copy link
Owner

ncw commented May 30, 2017

How are you getting on with this?

@myitcv
Copy link
Contributor Author

myitcv commented May 30, 2017

@ncw apologies - it's still on my TODO list. Getting bogged down with other things at the moment...

@ncw
Copy link
Owner

ncw commented May 30, 2017

No problems!

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 this pull request may close these issues.

2 participants