Skip to content
This repository has been archived by the owner on Jul 22, 2024. It is now read-only.

Commit

Permalink
Document behaviour of squash when decoding struct->map
Browse files Browse the repository at this point in the history
  • Loading branch information
dnephin committed Dec 22, 2020
1 parent 9ed2c4b commit 35a4b15
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions mapstructure.go
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,17 @@
// "name": "alice",
// }
//
// When decoding from a struct to a map, the squash tag squashes the struct
// fields into a single map. Using the example structs from above:
//
// Friend{Person: Person{Name: "alice"}}
//
// Will be decoded into a map:
//
// map[string]interface{}{
// "name": "alice",
// }
//
// DecoderConfig has a field that changes the behavior of mapstructure
// to always squash embedded structs.
//
Expand Down

0 comments on commit 35a4b15

Please sign in to comment.