Codebase list golang-github-mitchellh-mapstructure / 55652fb
Merge pull request #184 from yamil-rivera/master Including 'Unexported fields' section to the docs Mitchell Hashimoto authored 4 years ago GitHub committed 4 years ago
1 changed file(s) with 25 addition(s) and 0 deletion(s). Raw diff Collapse all Expand all
113113 // type Source {
114114 // Age int `mapstructure:",omitempty"`
115115 // }
116 //
117 // Unexported fields
118 //
119 // Since unexported (private) struct fields cannot be set outside the package
120 // where they are defined, the decoder will simply skip them.
121 //
122 // For this output type definition:
123 //
124 // type Exported struct {
125 // private string // this unexported field will be skipped
126 // Public string
127 // }
128 //
129 // Using this map as input:
130 //
131 // map[string]interface{}{
132 // "private": "I will be ignored",
133 // "Public": "I made it through!",
134 // }
135 //
136 // The following struct will be decoded:
137 //
138 // type Exported struct {
139 // private: "" // field is left with an empty string (zero value)
140 // Public: "I made it through!"
116141 //
117142 // Other Configuration
118143 //