diff options
| author | Brad Fitzpatrick <bradfitz@tailscale.com> | 2024-05-05 12:02:47 -0700 |
|---|---|---|
| committer | Brad Fitzpatrick <brad@danga.com> | 2024-05-05 21:14:28 -0700 |
| commit | 1a963342c7df80e4f756c1e5bb2ae7d0eae036e3 (patch) | |
| tree | fb98a48a2f57e72eb2c400c28843bbc789c6e5b4 /control/controlknobs/controlknobs.go | |
| parent | 80decd83c19d1536df482ee1a171663d923a7d7b (diff) | |
| download | tailscale-1a963342c7df80e4f756c1e5bb2ae7d0eae036e3.tar.xz tailscale-1a963342c7df80e4f756c1e5bb2ae7d0eae036e3.zip | |
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>
Diffstat (limited to 'control/controlknobs/controlknobs.go')
0 files changed, 0 insertions, 0 deletions
