cast
cast copied to clipboard
Add ToStringMapStruct()
Add the possibility to cast a slice into a hashset (map[string]struct{}
).
The struct{}
element worth 0 byte, and it's really useful for checking if a key is present. here an article about the empty struct.
This pull request is link with https://github.com/spf13/viper/pull/437 to add this feature for parsing slice.