Skip to content

Commit

Permalink
deps: update to go-set/v2
Browse files Browse the repository at this point in the history
  • Loading branch information
shoenig committed Oct 31, 2023
1 parent f53aa2e commit 84515e9
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 13 deletions.
6 changes: 4 additions & 2 deletions go.mod
Original file line number Diff line number Diff line change
@@ -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
Expand Down
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
@@ -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=
Expand Down
18 changes: 9 additions & 9 deletions landlock_linux.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import (
"fmt"
"syscall"

"github.com/hashicorp/go-set"
"github.com/hashicorp/go-set/v2"
"golang.org/x/sys/unix"
)

Expand All @@ -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)
}
Expand Down

0 comments on commit 84515e9

Please sign in to comment.