Closed iangallOlive closed 4 years ago
@asticode Hopefully resolved everything you requested! Let me know if you want anything else changed, I'm happy to do whatever!
FYI I've created a v0.6.0
tag
@asticode Thank you so much for the review/merge/tag!
This originated because I had to set the bind data's
output_path
to a subdirectory in my project.Specifically, I'm setting
output_path
to "bind", so that allbind_*.go
files go into./bind/
, and I reference them by importinggithub.com/my/module/bind
. This works well, except theldflags
that are set by this bundler (AppName
,BuiltAt
, etc.) no longer work. This is because thego build
flags that end up being set are like-X "bind.AppName=...
. The problem with this is thatgo build
doesn't target thebind
package in the way you'd expect (I'd expect how everything's currently set up to just work). Apparently, you need to use the full path (I'm not sure of the right name of this) to it, from the root of your project/module. But anyway, I needed the option to set the target package used in theldflags
different from the actualpackage
used for thebindata
config. So in the end, this is what the relevant part of mybundler.json
would look like:This PR should leave everything working the same as it always has, but adds the ability to set the package used in
ldflags
if you want.Also, added more info for this bind data stuff to the README, and did some random cleanup.