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

error state after yaml parse error due to embed.go being deleted #239

Open
ajbeattie-snyk opened this issue Aug 26, 2022 · 0 comments
Open

Comments

@ajbeattie-snyk
Copy link
Contributor

Hi,

I recently starting using vervet for the first time and ran into a bug where I had to manually recreate an embed.go placeholder file in order to successfully generate code again after encountering a yaml parsing error.

The steps that led to the bug:

  • use vervet to generate code/specs successfully
  • import the generated versions go package (which just contains embed.go) somewhere, e.g. in main.go
  • attempt to generate again but with a syntax error in one of your spec.yaml files
  • fix the syntax error, then attempt to generate again

The go compiler will complain about the import of the versions package, since that package is now empty.

This was confusing at first, since I had just bootstrapped the project from our go service template and wasn't very familiar with vervet or how everything was wired up. Luckily I eventually noticed the deletion of embed.go in a git diff, so I manually recreated it and was able to proceed.

A quick look at the code and it seems this is a result of vervet clearing the output directory at the beginning of the build step, so any errors that occur before embed.go is rewritten will lead to this same state.

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

1 participant