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

Generate bindata on build #36

Closed
DavidJFelix opened this issue Jan 8, 2016 · 4 comments
Closed

Generate bindata on build #36

DavidJFelix opened this issue Jan 8, 2016 · 4 comments

Comments

@DavidJFelix
Copy link

Right now, changing the web source does nothing if you don't run go-bindata and create a new bindata.go file. I think this is probably a bit confusing to people looking to expand on the project and a bit of a VCS-antipattern. Typically with projects that use generated source code (see protobuf, thrift, etc), there is a "gen" stage that is done before the "build" stage.

We could implement this with a Makefile that builds bindata.go.

Let me know how you feel about this.

@rach
Copy link
Owner

rach commented Jan 8, 2016

Your are totally right. Thanks for your feedback.
I use go generate && go build to generate the bindata.go but I should have at least documented the build process.
I'm 200% in favor of Makefile because you also have to build the frontend with webasset and I couldn't make webasset run go generate. I don't know why but I didn't dig out in problem.
I will try to write a makefile tonight.
Feel free to suggest other improvements

@DavidJFelix
Copy link
Author

none yet, I appreciate the quick response.

I'll admit, I opened this issue because I loved how pome bundled everything into one executable and I immediately started trying to figure out how to replicate the feature in some of my go services.

@rach
Copy link
Owner

rach commented Jan 8, 2016

It's decent as solution if you build something for a small traffic so it works for Pome as it's not made for being public. A lot of asset serving tool use kernel feature from what I'm aware to be efficient, I didn't test but I have doubt that serving the asset from go will be efficient.
Also if you go with this kind of technique then look at AssetFs for bindata, otherwise you will have to code how to figure out all the content-type.
https://github.com/rach/pome/blob/master/web.go#L43-L44

@rach
Copy link
Owner

rach commented Jan 15, 2016

There is now a Makefile in develop to build the different part of the project

@rach rach closed this as completed Jan 15, 2016
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