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

Keytrail shadowed in Walker #97

Open
GeorgeDuckman opened this issue Oct 24, 2023 · 0 comments
Open

Keytrail shadowed in Walker #97

GeorgeDuckman opened this issue Oct 24, 2023 · 0 comments

Comments

@GeorgeDuckman
Copy link

GeorgeDuckman commented Oct 24, 2023

Hi,

I might have found an issue, sorry if I'm wrong, but the variable keytrail in the function walkBlock is shadowed by the function argument.

func (w *Walker) walkBlock(body *hclwrite.Body, queries []query.Query, index int, keytrail []string) error {
	for _, block := range body.Blocks() {
		blockIndex := index
		if !queries[blockIndex].Match(block.Type()) {
			continue
		}

		blockIndex++
		keytrail := append(keytrail, block.Type()) // Right there, should be '=' not ':='
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