Skip to content

Generate bindata on build #36

Closed
Closed

Description

@DavidJFelix

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.

Activity

  1. rach commented on Jan 8, 2016

    @rach
    Owner

    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

  2. DavidJFelix commented on Jan 8, 2016

    @DavidJFelix
    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.

  3. rach commented on Jan 8, 2016

    @rach
    Owner

    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

  4. added a commit that references this issue on Jan 12, 2016
    0da92a9
  5. rach commented on Jan 15, 2016

    @rach
    Owner

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions

      ⌂ 换网址