-
Notifications
You must be signed in to change notification settings - Fork 77
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
Panic when calling LoadModuleFromFile #61
Comments
In function ParseHCL, not all fields of tfconfig.Module is checked, so panic will happen. Fix #hashicorp#61
In function ParseHCL, not all fields of tfconfig.Module is checked, so panic will happen. Fix #hashicorp#61
If you replace this mod := tfconfig.Module{Variables: map[string]*tfconfig.Variable{}} with mod := tfconfig.NewModule() then your example should not panic. |
@radeksimko Thanks for the reply. But there is no I think nil checking won't do anything bad in the PR, right?
|
I don't know how does your API work, but I believe that Assuming that you can expose the directory through that interface you should be able to make it work: terraform-config-inspect/tfconfig/filesystem.go Lines 8 to 22 in 9a80970
The We use that exact function inside Terraform LS where files (and their content) also come via API.
AFAICT with the In Go constructors usually follow a particular naming convention - so I'd expect people to look for |
Terraform Configuration
rds.tf
is as below.Try to get all
variable
information but panic happended.It seems that all fields of
tfconfig.Module
has to be set even though I justvariable
from it, or panic will happen.The text was updated successfully, but these errors were encountered: