mirror of
https://github.com/hashicorp/packer.git
synced 2026-05-28 04:35:38 -04:00
log& skip field if struct tag parse did not work
This commit is contained in:
parent
731904d3d2
commit
dc5bde97d7
1 changed files with 5 additions and 1 deletions
|
|
@ -415,7 +415,11 @@ func getMapstructureSquashedStruct(topPkg *types.Package, utStruct *types.Struct
|
|||
if _, ok := field.Type().(*types.Signature); ok {
|
||||
continue // ignore funcs
|
||||
}
|
||||
structtag, _ := structtag.Parse(tag)
|
||||
structtag, err := structtag.Parse(tag)
|
||||
if err != nil {
|
||||
log.Printf("could not parse field tag %s of : %v", tag, err)
|
||||
continue
|
||||
}
|
||||
if ms, err := structtag.Get("mapstructure"); err != nil {
|
||||
//no mapstructure tag
|
||||
} else if ms.HasOption("squash") {
|
||||
|
|
|
|||
Loading…
Reference in a new issue