Skip to content

Commit

Permalink
Update README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
newodahs authored May 10, 2024
1 parent 957e6eb commit 230fc3b
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,12 +44,12 @@ testStruct := someStruct{
}
}
outputMap := ConvertStruct("", testStruct)
outputMap := ConvertStruct(testStruct)
```
The key for an item on the `SomeMap` map in the `InnerStruct` would appear in the output map as the following key: `InnerStruct.SomeMap.test => 1`.

Additional tag options include (comma-separated, after the name):
* `omitempty` - nil-able (and only nil-able) types are not added to the output map if set to nil.
* `ignoreparents` - ignores all of the parents (prefixes) above the current position of nested fields, effectively flattening the keys (to a degree; beware of potential output map key conflicts when using this).

For `ignoreparents`, given the same `someStruct` example above, if the `SomeMap` field were to have `ignoreparents` then it would be keyed as the following in the output map: `SomeMap.test => [value]` (loss of the `InnerStruct` prefix).
For `ignoreparents`, given the same `someStruct` example above, if the `SomeMap` field were to have `ignoreparents` then it would be keyed as the following in the output map: `SomeMap.test => [value]` (loss of the `InnerStruct` prefix).

0 comments on commit 230fc3b

Please sign in to comment.