Skip to content

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 63a5af0
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions mapstructure.go
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: "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 63a5af0

Please sign in to comment.