From ea1736083acfc2f6ff22e535f0d1fb1e9e9b4caa Mon Sep 17 00:00:00 2001 From: Alexandre Pujol Date: Fri, 12 Apr 2024 20:07:05 +0100 Subject: [PATCH] chore: use slices from standard library. --- cmd/aa-log/main.go | 2 +- pkg/aa/mount.go | 4 ++-- pkg/aa/profile.go | 2 +- pkg/aa/variables.go | 3 +-- pkg/logs/logs.go | 2 +- pkg/prebuild/builder/complain.go | 2 +- pkg/prebuild/builder/core_test.go | 3 +-- pkg/prebuild/builder/enforce.go | 2 +- pkg/prebuild/cfg/os.go | 2 +- pkg/prebuild/directive/exec.go | 2 +- pkg/prebuild/directive/filter.go | 2 +- pkg/prebuild/prepare/core_test.go | 2 +- 12 files changed, 13 insertions(+), 15 deletions(-) diff --git a/cmd/aa-log/main.go b/cmd/aa-log/main.go index 89ca1d0b..cbc59c9e 100644 --- a/cmd/aa-log/main.go +++ b/cmd/aa-log/main.go @@ -9,10 +9,10 @@ import ( "fmt" "io" "os" + "slices" "strings" "github.com/roddhjav/apparmor.d/pkg/logs" - "golang.org/x/exp/slices" ) const usage = `aa-log [-h] [--systemd] [--file file] [--rules | --raw] [profile] diff --git a/pkg/aa/mount.go b/pkg/aa/mount.go index 0dac82ff..35875c4a 100644 --- a/pkg/aa/mount.go +++ b/pkg/aa/mount.go @@ -5,9 +5,9 @@ package aa import ( + "slices" "strings" - - "golang.org/x/exp/slices" +) ) type MountConditions struct { diff --git a/pkg/aa/profile.go b/pkg/aa/profile.go index b5aa2d7b..2e97b9d4 100644 --- a/pkg/aa/profile.go +++ b/pkg/aa/profile.go @@ -7,11 +7,11 @@ package aa import ( "bytes" "reflect" + "slices" "sort" "strings" "github.com/arduino/go-paths-helper" - "golang.org/x/exp/slices" ) // Default Apparmor magic directory: /etc/apparmor.d/. diff --git a/pkg/aa/variables.go b/pkg/aa/variables.go index 6105cc30..ddd2e3d1 100644 --- a/pkg/aa/variables.go +++ b/pkg/aa/variables.go @@ -9,9 +9,8 @@ package aa import ( "regexp" + "slices" "strings" - - "golang.org/x/exp/slices" ) var ( diff --git a/pkg/logs/logs.go b/pkg/logs/logs.go index 28c14ffb..913f1172 100644 --- a/pkg/logs/logs.go +++ b/pkg/logs/logs.go @@ -7,11 +7,11 @@ package logs import ( "io" "regexp" + "slices" "strings" "github.com/roddhjav/apparmor.d/pkg/aa" "github.com/roddhjav/apparmor.d/pkg/util" - "golang.org/x/exp/slices" ) // Colors diff --git a/pkg/prebuild/builder/complain.go b/pkg/prebuild/builder/complain.go index 3dc04166..3970e6df 100644 --- a/pkg/prebuild/builder/complain.go +++ b/pkg/prebuild/builder/complain.go @@ -6,10 +6,10 @@ package builder import ( "regexp" + "slices" "strings" "github.com/roddhjav/apparmor.d/pkg/prebuild/cfg" - "golang.org/x/exp/slices" ) var ( diff --git a/pkg/prebuild/builder/core_test.go b/pkg/prebuild/builder/core_test.go index 3b620e6b..b0c59e77 100644 --- a/pkg/prebuild/builder/core_test.go +++ b/pkg/prebuild/builder/core_test.go @@ -5,9 +5,8 @@ package builder import ( + "slices" "testing" - - "golang.org/x/exp/slices" ) func TestBuilder_Apply(t *testing.T) { diff --git a/pkg/prebuild/builder/enforce.go b/pkg/prebuild/builder/enforce.go index 8c4aaccf..a3bd2c1d 100644 --- a/pkg/prebuild/builder/enforce.go +++ b/pkg/prebuild/builder/enforce.go @@ -5,10 +5,10 @@ package builder import ( + "slices" "strings" "github.com/roddhjav/apparmor.d/pkg/prebuild/cfg" - "golang.org/x/exp/slices" ) type Enforce struct { diff --git a/pkg/prebuild/cfg/os.go b/pkg/prebuild/cfg/os.go index aa995200..d792c490 100644 --- a/pkg/prebuild/cfg/os.go +++ b/pkg/prebuild/cfg/os.go @@ -6,10 +6,10 @@ package cfg import ( "os" + "slices" "strings" "github.com/arduino/go-paths-helper" - "golang.org/x/exp/slices" ) var ( diff --git a/pkg/prebuild/directive/exec.go b/pkg/prebuild/directive/exec.go index e0b1e2e1..db08ba6e 100644 --- a/pkg/prebuild/directive/exec.go +++ b/pkg/prebuild/directive/exec.go @@ -5,12 +5,12 @@ package directive import ( + "slices" "strings" "github.com/roddhjav/apparmor.d/pkg/aa" "github.com/roddhjav/apparmor.d/pkg/prebuild/cfg" "github.com/roddhjav/apparmor.d/pkg/util" - "golang.org/x/exp/slices" ) type Exec struct { diff --git a/pkg/prebuild/directive/filter.go b/pkg/prebuild/directive/filter.go index 8b5502ca..b4cc54af 100644 --- a/pkg/prebuild/directive/filter.go +++ b/pkg/prebuild/directive/filter.go @@ -6,10 +6,10 @@ package directive import ( "regexp" + "slices" "strings" "github.com/roddhjav/apparmor.d/pkg/prebuild/cfg" - "golang.org/x/exp/slices" ) type FilterOnly struct { diff --git a/pkg/prebuild/prepare/core_test.go b/pkg/prebuild/prepare/core_test.go index 0e8f913d..591bf838 100644 --- a/pkg/prebuild/prepare/core_test.go +++ b/pkg/prebuild/prepare/core_test.go @@ -7,11 +7,11 @@ package prepare import ( "os" "os/exec" + "slices" "testing" "github.com/arduino/go-paths-helper" "github.com/roddhjav/apparmor.d/pkg/prebuild/cfg" - "golang.org/x/exp/slices" ) func chdirGitRoot() {