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

Extra remaining fields in the presence of a slice of structs #16

Open
kalfonso opened this issue Jun 20, 2022 · 0 comments
Open

Extra remaining fields in the presence of a slice of structs #16

kalfonso opened this issue Jun 20, 2022 · 0 comments

Comments

@kalfonso
Copy link
Contributor

I ran into an issue when trying to obtain remaining fields for the example below, the second nested field (your) was returned as part of remaining fields.

HCL:

name = "hello"
nested {
  name = "my"
}
nested {
  name = "your"
}
message1 = "wonderful"
message2 = world
type remainStruct struct {
	Name   string          `hcl:"name"`
	Nested []*remainNested `hcl:"nested,optional"`
	Remain []*Entry        `hcl:",remain"`
}

type remainNested struct {
	Name string `hcl:"name"`
}

The image below shows the third remaining field in the unmarshalled object:

Screen Shot 2022-06-20 at 11 10 52 AM

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