tailscale/util/set
Brad Fitzpatrick 1a963342c7 util/set: add Of variant of SetOf that takes variadic parameter
set.Of(1, 2, 3) is prettier than set.SetOf([]int{1, 2, 3}).

I was going to change the signature of SetOf but then I noticed its
name has stutter anyway, so I kept it for compatibility. People can
prefer to use set.Of for new code or slowly migrate.

Also add a lazy Make method, which I often find myself wanting,
without having to resort to uglier mak.Set(&set, k, struct{}{}).

Updates #cleanup

Change-Id: Ic6f3870115334efcbd65e79c437de2ad3edb7625
Signed-off-by: Brad Fitzpatrick <bradfitz@tailscale.com>
2024-05-05 21:14:28 -07:00
..
handle.go util/set: add some useful utility functions for Set (#9535) 2023-09-29 14:31:02 -07:00
set.go util/set: add Of variant of SetOf that takes variadic parameter 2024-05-05 21:14:28 -07:00
set_test.go util/set: add Of variant of SetOf that takes variadic parameter 2024-05-05 21:14:28 -07:00
slice.go all: use Go 1.22 range-over-int 2024-04-16 15:32:38 -07:00
slice_test.go util/set: move Slice type from corp to oss 2023-04-14 19:25:39 -04:00