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 35df3c9 commit 756d60b
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)

Check failure on line 25 in landlock_linux.go

View workflow job for this annotation

GitHub Actions / run-tests (ubuntu-22.04)

undefined: set (typecheck)

Check failure on line 25 in landlock_linux.go

View workflow job for this annotation

GitHub Actions / run-tests (ubuntu-20.04)

undefined: set (typecheck)
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 756d60b

Please sign in to comment.