The asset.go file contains my development http.FileSystem declaration. The generate.go contains the development only main package that generates the code.
I want to generate asset_vfsdata.go in the same folder as asset.go.
I want to use air to live reload asset_vfsdata.go. So ideally I want to run the generate.go command at the root folder.
My problem is this: if I run the generate.go at the root folder (mypackage), the generated go file will be placed directly at root, which fails to achieve (2). I tried adding path to vfsgen.Options.Filename, but it seems to be ignored by vfsgen.
I think the clean to do it is to have a vfsgen.Options that specifies the relative output folder somehow.
I am writing a library that has a subpackage, which needs to have assets generated. The folder structure looks like this:
Here are my constrains:
asset.go
file contains my developmenthttp.FileSystem
declaration. Thegenerate.go
contains the development onlymain
package that generates the code.asset_vfsdata.go
in the same folder asasset.go
.asset_vfsdata.go
. So ideally I want to run thegenerate.go
command at the root folder.My problem is this: if I run the
generate.go
at the root folder (mypackage
), the generated go file will be placed directly at root, which fails to achieve (2). I tried adding path tovfsgen.Options.Filename
, but it seems to be ignored by vfsgen.I think the clean to do it is to have a
vfsgen.Options
that specifies the relative output folder somehow.