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

GetAsString: found but is of wrong type, query requested key/literal, found list" #17

Closed
sebglon opened this issue Jun 28, 2019 · 2 comments

Comments

@sebglon
Copy link

sebglon commented Jun 28, 2019

I use this code:

	tfParamPath := "module." + moduleName + "." + field
	hclDoc, err := hclq.FromFile(file)
	if err != nil {
		return []string{}, errors.Wrapf(err, "Failed to read terraform file: %s", file)
	}
	res, err := hclDoc.GetAsList(tfParamPath)

But it fail with error:
key 'partner_ips' found but is of wrong type, query requested key/literal, found list

I use github.com/mattolenik/hclq v0.0.0-20190520172613-e55c48cdefcc

@sebglon
Copy link
Author

sebglon commented Jul 1, 2019

Solved.
Sorry i have lost [] at the end of the query

@sebglon sebglon closed this as completed Jul 1, 2019
@mattolenik
Copy link
Owner

mattolenik commented Jul 2, 2019

Well the error message certainly could be improved, so thanks for raising the issue! I opened #18 to track improving the message.

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