Skip to content

Commit

Permalink
Including 'Unexported fields' section to the docs
Browse files Browse the repository at this point in the history
  • Loading branch information
yamil-rivera committed Mar 30, 2020
1 parent ba04b21 commit 9080aac
Showing 1 changed file with 26 additions and 0 deletions.
26 changes: 26 additions & 0 deletions mapstructure.go
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,32 @@
// "address": "123 Maple St.",
// }
//
// Unexported fields
//
// Since unexported (private) struct fields cannot be set outside the package
// where they are defined, the decoder will simply skip them.
//
// For this output type definition:
//
// type Exported struct {
// private string // this unexported field will be skipped
// Public string
// }
//
// Using this map as input:
//
// map[string]interface{}{
// "private": "I will be ignored",
// "Public": "I made it through!",
// }
//
// The following struct will be decoded:
//
// type Exported struct {
// private: "" // field is left with an empty string (zero value)
// Public: "I made it through!"
// }
//
// Other Configuration
//
// mapstructure is highly configurable. See the DecoderConfig struct
Expand Down

0 comments on commit 9080aac

Please sign in to comment.