From 756d60b21fd4db6439be1f47b3ea067c838bbf79 Mon Sep 17 00:00:00 2001 From: Seth Hoenig Date: Tue, 31 Oct 2023 22:22:21 +0000 Subject: [PATCH] deps: update to go-set/v2 --- go.mod | 6 ++++-- go.sum | 4 ++-- landlock_linux.go | 18 +++++++++--------- 3 files changed, 15 insertions(+), 13 deletions(-) diff --git a/go.mod b/go.mod index 3bcb584..e7e4554 100644 --- a/go.mod +++ b/go.mod @@ -1,9 +1,11 @@ module github.com/shoenig/go-landlock -go 1.20 +go 1.21 + +toolchain go1.21.3 require ( - github.com/hashicorp/go-set v0.1.9 + github.com/hashicorp/go-set/v2 v2.0.0-alpha.3 github.com/shoenig/test v0.6.7 golang.org/x/sys v0.11.0 kernel.org/pub/linux/libs/security/libcap/psx v1.2.69 diff --git a/go.sum b/go.sum index 129e424..8cd58f8 100644 --- a/go.sum +++ b/go.sum @@ -1,7 +1,7 @@ github.com/google/go-cmp v0.5.9 h1:O2Tfq5qg4qc4AmwVlvv0oLiVAGB7enBSJ2x2DqQFi38= github.com/google/go-cmp v0.5.9/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= -github.com/hashicorp/go-set v0.1.9 h1:XuQSsDfOAvgRjoKWG2qg8NxVEQJMXGdrZh8BgX6O8n4= -github.com/hashicorp/go-set v0.1.9/go.mod h1:/IR7VHUqnKI+QfKkaMjZ575bf65Y8DzHRKnOobRpNcQ= +github.com/hashicorp/go-set/v2 v2.0.0-alpha.3 h1:ZpDBhigUACKvj4pVS973badI8ult/5U5TiPoPkdPgVc= +github.com/hashicorp/go-set/v2 v2.0.0-alpha.3/go.mod h1:6q4nh8UCVZODn2tJ5RbJi8+ki7pjZBsAEYGt6yaGeTo= github.com/shoenig/test v0.6.7 h1:k92ohN9VyRfZn0ezNfwamtIBT/5byyfLVktRmL/Jmek= github.com/shoenig/test v0.6.7/go.mod h1:byHiCGXqrVaflBLAMq/srcZIHynQPQgeyvkvXnjqq0k= golang.org/x/sys v0.11.0 h1:eG7RXZHdqOJ1i+0lgLgCpSXAp6M3LYlAo6osgSi0xOM= diff --git a/landlock_linux.go b/landlock_linux.go index d06b42c..c8c80f6 100644 --- a/landlock_linux.go +++ b/landlock_linux.go @@ -7,7 +7,7 @@ import ( "fmt" "syscall" - "github.com/hashicorp/go-set" + "github.com/hashicorp/go-set/v2" "golang.org/x/sys/unix" ) @@ -22,23 +22,23 @@ type locker struct { // New creates a Locker that allows the given paths and permissions. func New(paths ...*Path) Locker { - s := set.NewHashSet[*Path, string](10) + s := set.NewHashSet[*Path](10) for _, path := range paths { switch path.mode { case modeShared: - s.InsertAll(shared) + s.InsertSlice(shared) case modeStdio: - s.InsertAll(stdio) + s.InsertSlice(stdio) case modeTTY: - s.InsertAll(tty) + s.InsertSlice(tty) case modeTmp: - s.InsertAll(tmp) + s.InsertSlice(tmp) case modeVMInfo: - s.InsertAll(vminfo) + s.InsertSlice(vminfo) case modeDNS: - s.InsertAll(dns) + s.InsertSlice(dns) case modeCerts: - s.InsertAll(certs) + s.InsertSlice(certs) default: s.Insert(path) }