embedded struct fields are not populated
- Dominant language
- Go
- Stars
- 5.8k
- Forks
- 657
- Avg merge
- 20h 36m
- Merged PRs (30d)
- 6
Description
Unmarshalling embedded struct fields works in `encoding/json` but not HCL (as of 5b7dbf7eefffea49afb3c9655d6582c72fae5fd1). Here's the code using `encoding/json`: https://play.golang.org/p/rrXXw7j8VM. The equivalent in HCL follows:
``` go
package main
import (
"fmt"
"github.com/hashicorp/hcl"
)
type Inner struct {
Dependencies []string `hcl:"dependencies"`
}
type Outer struct {
Inner
Name string `hcl:"name"`
}
func main() {
x := new(Outer)
err := hcl.Unmarshal(
[]byte(`
name = "test"
dependencies = ["a", "b", "c"]
`),
x,
)
fmt.Printf("%+v %v\n", x, err)
}
```
Would this be a contribution y'all are interested in? If you are and you could point me toward a good place to get started, I'd appreciate it :)
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.