From a3f21425e5451bdac154d857b4e8e63a799e1f7b Mon Sep 17 00:00:00 2001 From: Alexandre Pujol Date: Thu, 17 Aug 2023 23:36:46 +0100 Subject: [PATCH] fix: remove unused go import. --- pkg/aa/profile_test.go | 32 ++++++++++++++++++++++++++++++++ pkg/aa/rules.go | 4 ---- pkg/aa/template.go | 1 - 3 files changed, 32 insertions(+), 5 deletions(-) create mode 100644 pkg/aa/profile_test.go diff --git a/pkg/aa/profile_test.go b/pkg/aa/profile_test.go new file mode 100644 index 00000000..db3ec359 --- /dev/null +++ b/pkg/aa/profile_test.go @@ -0,0 +1,32 @@ +// apparmor.d - Full set of apparmor profiles +// Copyright (C) 2023 Alexandre Pujol +// SPDX-License-Identifier: GPL-2.0-only + +package aa + +import ( + "testing" +) + +func TestAppArmorProfile_String(t *testing.T) { + tests := []struct { + name string + p AppArmorProfile + want string + }{ + { + name: "empty", + p: AppArmorProfile{}, + want: `profile { +} +`, + }, + } + for _, tt := range tests { + t.Run(tt.name, func(t *testing.T) { + if got := tt.p.String(); got != tt.want { + t.Errorf("AppArmorProfile.String() = %v, want %v", got, tt.want) + } + }) + } +} diff --git a/pkg/aa/rules.go b/pkg/aa/rules.go index 3244247d..997bbd1f 100644 --- a/pkg/aa/rules.go +++ b/pkg/aa/rules.go @@ -4,10 +4,6 @@ package aa -import ( - "golang.org/x/exp/slices" -) - // Preamble section of a profile type Preamble struct { Abi []Abi diff --git a/pkg/aa/template.go b/pkg/aa/template.go index a577af54..2484c704 100644 --- a/pkg/aa/template.go +++ b/pkg/aa/template.go @@ -6,7 +6,6 @@ package aa import ( _ "embed" - "strings" "text/template" )