-
-
Notifications
You must be signed in to change notification settings - Fork 59
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: Add RandomMapKey and RandomMapValuet
These two functions are analog to RandomStringMapKey and RandomStringMapValue, in the same way RandomElement is to RandomStringElement. This was something I felt was missing as I was trying to get a random map element from a map than was not a map[string]string. Unlike their String counterpart though, no sorting is performed. Doing a sort would require the generics to be constrained to cmd.Ordered which I feel is too restrictive.
- Loading branch information
1 parent
62c2c94
commit 017255b
Showing
2 changed files
with
44 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters