@@ -13,7 +13,7 @@ func ID[V any](v V) V {
1313 return v
1414}
1515
16- // SliceOf creates a []E generator. SliceOf(elem) is equivalent to SliceOfN(elem, -1, -1).
16+ // SliceOf is a shorthand for [ SliceOfN] (elem, -1, -1).
1717func SliceOf [E any ](elem * Generator [E ]) * Generator [[]E ] {
1818 return SliceOfN (elem , - 1 , - 1 )
1919}
@@ -31,9 +31,7 @@ func SliceOfN[E any](elem *Generator[E], minLen int, maxLen int) *Generator[[]E]
3131 })
3232}
3333
34- // SliceOfDistinct creates a []E generator. Elements of each generated slice are distinct according to keyFn.
35- // [ID] helper can be used as keyFn to generate slices of distinct comparable elements.
36- // SliceOfDistinct(elem, keyFn) is equivalent to SliceOfNDistinct(elem, -1, -1, keyFn).
34+ // SliceOfDistinct is a shorthand for [SliceOfNDistinct](elem, -1, -1, keyFn).
3735func SliceOfDistinct [E any , K comparable ](elem * Generator [E ], keyFn func (E ) K ) * Generator [[]E ] {
3836 return SliceOfNDistinct (elem , - 1 , - 1 , keyFn )
3937}
@@ -103,7 +101,7 @@ func (g *sliceGen[E, K]) value(t *T) []E {
103101 return sl
104102}
105103
106- // MapOf creates a map[K]V generator. MapOf(key, val) is equivalent to MapOfN(key, val, -1, -1).
104+ // MapOf is a shorthand for [ MapOfN] (key, val, -1, -1).
107105func MapOf [K comparable , V any ](key * Generator [K ], val * Generator [V ]) * Generator [map [K ]V ] {
108106 return MapOfN (key , val , - 1 , - 1 )
109107}
@@ -122,8 +120,7 @@ func MapOfN[K comparable, V any](key *Generator[K], val *Generator[V], minLen in
122120 })
123121}
124122
125- // MapOfValues creates a map[K]V generator, where keys are generated by applying keyFn to values.
126- // MapOfValues(val, keyFn) is equivalent to MapOfNValues(val, -1, -1, keyFn).
123+ // MapOfValues is a shorthand for [MapOfNValues](val, -1, -1, keyFn).
127124func MapOfValues [K comparable , V any ](val * Generator [V ], keyFn func (V ) K ) * Generator [map [K ]V ] {
128125 return MapOfNValues (val , - 1 , - 1 , keyFn )
129126}
0 commit comments