chore: use internal paths lib.

This commit is contained in:
Alexandre Pujol 2024-04-28 00:36:16 +01:00
parent f66789d381
commit 926e146dad
No known key found for this signature in database
GPG Key ID: C5469996F0DF68EC
20 changed files with 25 additions and 20 deletions

7
go.mod
View File

@ -3,6 +3,11 @@ module github.com/roddhjav/apparmor.d
go 1.22 go 1.22
require ( require (
github.com/arduino/go-paths-helper v1.12.0 github.com/stretchr/testify v1.9.0
gopkg.in/yaml.v3 v3.0.1 gopkg.in/yaml.v3 v3.0.1
) )
require (
github.com/davecgh/go-spew v1.1.1 // indirect
github.com/pmezard/go-difflib v1.0.0 // indirect
)

View File

@ -11,7 +11,7 @@ import (
"sort" "sort"
"strings" "strings"
"github.com/arduino/go-paths-helper" "github.com/roddhjav/apparmor.d/pkg/paths"
) )
// Default Apparmor magic directory: /etc/apparmor.d/. // Default Apparmor magic directory: /etc/apparmor.d/.

View File

@ -9,7 +9,7 @@ import (
"strings" "strings"
"testing" "testing"
"github.com/arduino/go-paths-helper" "github.com/roddhjav/apparmor.d/pkg/paths"
) )
func readprofile(path string) string { func readprofile(path string) string {

View File

@ -4,7 +4,7 @@
package cfg package cfg
import "github.com/arduino/go-paths-helper" import "github.com/roddhjav/apparmor.d/pkg/paths"
var ( var (
// Root is the root directory for the build // Root is the root directory for the build

View File

@ -8,7 +8,7 @@ import (
"reflect" "reflect"
"testing" "testing"
"github.com/arduino/go-paths-helper" "github.com/roddhjav/apparmor.d/pkg/paths"
) )
func TestFlagger_Read(t *testing.T) { func TestFlagger_Read(t *testing.T) {

View File

@ -9,7 +9,7 @@ import (
"slices" "slices"
"strings" "strings"
"github.com/arduino/go-paths-helper" "github.com/roddhjav/apparmor.d/pkg/paths"
) )
var ( var (

View File

@ -8,7 +8,7 @@ import (
"reflect" "reflect"
"testing" "testing"
"github.com/arduino/go-paths-helper" "github.com/roddhjav/apparmor.d/pkg/paths"
) )
const ( const (

View File

@ -9,7 +9,7 @@ import (
"regexp" "regexp"
"strings" "strings"
"github.com/arduino/go-paths-helper" "github.com/roddhjav/apparmor.d/pkg/paths"
"github.com/roddhjav/apparmor.d/pkg/prebuild/cfg" "github.com/roddhjav/apparmor.d/pkg/prebuild/cfg"
) )

View File

@ -8,7 +8,7 @@ import (
"reflect" "reflect"
"testing" "testing"
"github.com/arduino/go-paths-helper" "github.com/roddhjav/apparmor.d/pkg/paths"
) )
func TestNewOption(t *testing.T) { func TestNewOption(t *testing.T) {

View File

@ -7,7 +7,7 @@ package directive
import ( import (
"testing" "testing"
"github.com/arduino/go-paths-helper" "github.com/roddhjav/apparmor.d/pkg/paths"
"github.com/roddhjav/apparmor.d/pkg/prebuild/cfg" "github.com/roddhjav/apparmor.d/pkg/prebuild/cfg"
) )

View File

@ -7,7 +7,7 @@ package directive
import ( import (
"testing" "testing"
"github.com/arduino/go-paths-helper" "github.com/roddhjav/apparmor.d/pkg/paths"
"github.com/roddhjav/apparmor.d/pkg/prebuild/cfg" "github.com/roddhjav/apparmor.d/pkg/prebuild/cfg"
) )

View File

@ -7,8 +7,8 @@ package prebuild
import ( import (
"strings" "strings"
"github.com/arduino/go-paths-helper"
"github.com/roddhjav/apparmor.d/pkg/logging" "github.com/roddhjav/apparmor.d/pkg/logging"
"github.com/roddhjav/apparmor.d/pkg/paths"
"github.com/roddhjav/apparmor.d/pkg/prebuild/builder" "github.com/roddhjav/apparmor.d/pkg/prebuild/builder"
"github.com/roddhjav/apparmor.d/pkg/prebuild/cfg" "github.com/roddhjav/apparmor.d/pkg/prebuild/cfg"
"github.com/roddhjav/apparmor.d/pkg/prebuild/directive" "github.com/roddhjav/apparmor.d/pkg/prebuild/directive"

View File

@ -9,7 +9,7 @@ import (
"os/exec" "os/exec"
"testing" "testing"
"github.com/arduino/go-paths-helper" "github.com/roddhjav/apparmor.d/pkg/paths"
"github.com/roddhjav/apparmor.d/pkg/prebuild/builder" "github.com/roddhjav/apparmor.d/pkg/prebuild/builder"
"github.com/roddhjav/apparmor.d/pkg/prebuild/cfg" "github.com/roddhjav/apparmor.d/pkg/prebuild/cfg"
"github.com/roddhjav/apparmor.d/pkg/prebuild/prepare" "github.com/roddhjav/apparmor.d/pkg/prebuild/prepare"

View File

@ -10,7 +10,7 @@ import (
"slices" "slices"
"testing" "testing"
"github.com/arduino/go-paths-helper" "github.com/roddhjav/apparmor.d/pkg/paths"
"github.com/roddhjav/apparmor.d/pkg/prebuild/cfg" "github.com/roddhjav/apparmor.d/pkg/prebuild/cfg"
) )

View File

@ -7,7 +7,7 @@ package prepare
import ( import (
"strings" "strings"
"github.com/arduino/go-paths-helper" "github.com/roddhjav/apparmor.d/pkg/paths"
"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"
) )

View File

@ -5,7 +5,7 @@
package prepare package prepare
import ( import (
"github.com/arduino/go-paths-helper" "github.com/roddhjav/apparmor.d/pkg/paths"
"github.com/roddhjav/apparmor.d/pkg/prebuild/cfg" "github.com/roddhjav/apparmor.d/pkg/prebuild/cfg"
) )

View File

@ -8,7 +8,7 @@ import (
"os" "os"
"path/filepath" "path/filepath"
"github.com/arduino/go-paths-helper" "github.com/roddhjav/apparmor.d/pkg/paths"
"github.com/roddhjav/apparmor.d/pkg/prebuild/cfg" "github.com/roddhjav/apparmor.d/pkg/prebuild/cfg"
) )

View File

@ -5,7 +5,7 @@
package prepare package prepare
import ( import (
"github.com/arduino/go-paths-helper" "github.com/roddhjav/apparmor.d/pkg/paths"
"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"
) )

View File

@ -10,7 +10,7 @@ import (
"slices" "slices"
"strings" "strings"
"github.com/arduino/go-paths-helper" "github.com/roddhjav/apparmor.d/pkg/paths"
) )
var ( var (

View File

@ -9,7 +9,7 @@ import (
"regexp" "regexp"
"testing" "testing"
"github.com/arduino/go-paths-helper" "github.com/roddhjav/apparmor.d/pkg/paths"
) )
func TestDecodeHexInString(t *testing.T) { func TestDecodeHexInString(t *testing.T) {