chore: use slices from standard library.

This commit is contained in:
Alexandre Pujol 2024-04-12 20:07:05 +01:00
parent 8b68132f0e
commit ea1736083a
Failed to generate hash of commit
12 changed files with 13 additions and 15 deletions

View file

@ -9,10 +9,10 @@ import (
"fmt" "fmt"
"io" "io"
"os" "os"
"slices"
"strings" "strings"
"github.com/roddhjav/apparmor.d/pkg/logs" "github.com/roddhjav/apparmor.d/pkg/logs"
"golang.org/x/exp/slices"
) )
const usage = `aa-log [-h] [--systemd] [--file file] [--rules | --raw] [profile] const usage = `aa-log [-h] [--systemd] [--file file] [--rules | --raw] [profile]

View file

@ -5,9 +5,9 @@
package aa package aa
import ( import (
"slices"
"strings" "strings"
)
"golang.org/x/exp/slices"
) )
type MountConditions struct { type MountConditions struct {

View file

@ -7,11 +7,11 @@ package aa
import ( import (
"bytes" "bytes"
"reflect" "reflect"
"slices"
"sort" "sort"
"strings" "strings"
"github.com/arduino/go-paths-helper" "github.com/arduino/go-paths-helper"
"golang.org/x/exp/slices"
) )
// Default Apparmor magic directory: /etc/apparmor.d/. // Default Apparmor magic directory: /etc/apparmor.d/.

View file

@ -9,9 +9,8 @@ package aa
import ( import (
"regexp" "regexp"
"slices"
"strings" "strings"
"golang.org/x/exp/slices"
) )
var ( var (

View file

@ -7,11 +7,11 @@ package logs
import ( import (
"io" "io"
"regexp" "regexp"
"slices"
"strings" "strings"
"github.com/roddhjav/apparmor.d/pkg/aa" "github.com/roddhjav/apparmor.d/pkg/aa"
"github.com/roddhjav/apparmor.d/pkg/util" "github.com/roddhjav/apparmor.d/pkg/util"
"golang.org/x/exp/slices"
) )
// Colors // Colors

View file

@ -6,10 +6,10 @@ package builder
import ( import (
"regexp" "regexp"
"slices"
"strings" "strings"
"github.com/roddhjav/apparmor.d/pkg/prebuild/cfg" "github.com/roddhjav/apparmor.d/pkg/prebuild/cfg"
"golang.org/x/exp/slices"
) )
var ( var (

View file

@ -5,9 +5,8 @@
package builder package builder
import ( import (
"slices"
"testing" "testing"
"golang.org/x/exp/slices"
) )
func TestBuilder_Apply(t *testing.T) { func TestBuilder_Apply(t *testing.T) {

View file

@ -5,10 +5,10 @@
package builder package builder
import ( import (
"slices"
"strings" "strings"
"github.com/roddhjav/apparmor.d/pkg/prebuild/cfg" "github.com/roddhjav/apparmor.d/pkg/prebuild/cfg"
"golang.org/x/exp/slices"
) )
type Enforce struct { type Enforce struct {

View file

@ -6,10 +6,10 @@ package cfg
import ( import (
"os" "os"
"slices"
"strings" "strings"
"github.com/arduino/go-paths-helper" "github.com/arduino/go-paths-helper"
"golang.org/x/exp/slices"
) )
var ( var (

View file

@ -5,12 +5,12 @@
package directive package directive
import ( import (
"slices"
"strings" "strings"
"github.com/roddhjav/apparmor.d/pkg/aa" "github.com/roddhjav/apparmor.d/pkg/aa"
"github.com/roddhjav/apparmor.d/pkg/prebuild/cfg" "github.com/roddhjav/apparmor.d/pkg/prebuild/cfg"
"github.com/roddhjav/apparmor.d/pkg/util" "github.com/roddhjav/apparmor.d/pkg/util"
"golang.org/x/exp/slices"
) )
type Exec struct { type Exec struct {

View file

@ -6,10 +6,10 @@ package directive
import ( import (
"regexp" "regexp"
"slices"
"strings" "strings"
"github.com/roddhjav/apparmor.d/pkg/prebuild/cfg" "github.com/roddhjav/apparmor.d/pkg/prebuild/cfg"
"golang.org/x/exp/slices"
) )
type FilterOnly struct { type FilterOnly struct {

View file

@ -7,11 +7,11 @@ package prepare
import ( import (
"os" "os"
"os/exec" "os/exec"
"slices"
"testing" "testing"
"github.com/arduino/go-paths-helper" "github.com/arduino/go-paths-helper"
"github.com/roddhjav/apparmor.d/pkg/prebuild/cfg" "github.com/roddhjav/apparmor.d/pkg/prebuild/cfg"
"golang.org/x/exp/slices"
) )
func chdirGitRoot() { func chdirGitRoot() {