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

Feature Request: path to generate file #90

Open
yookoala opened this issue Feb 6, 2021 · 1 comment
Open

Feature Request: path to generate file #90

yookoala opened this issue Feb 6, 2021 · 1 comment

Comments

@yookoala
Copy link

yookoala commented Feb 6, 2021

I am writing a library that has a subpackage, which needs to have assets generated. The folder structure looks like this:

mypackage/
  .air.toml
  cmd/
    example/
      main.go
      resources/
        generate.go
        asset.go
        templates/
          index.go.html
          login.go.html

Here are my constrains:

  1. The asset.go file contains my development http.FileSystem declaration. The generate.go contains the development only main package that generates the code.
  2. I want to generate asset_vfsdata.go in the same folder as asset.go.
  3. 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.

@dmitshur
Copy link
Member

dmitshur commented Feb 6, 2021

I tried adding path to vfsgen.Options.Filename, but it seems to be ignored by vfsgen.

That shouldn't be the case. Can you show a snippet that reproduces this behavior?

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