mirror of
https://github.com/roddhjav/apparmor.d.git
synced 2025-01-18 00:48:10 +01:00
fix: remove unused import, add missing InSlice.
This commit is contained in:
parent
57ee9f54c4
commit
22b12fade0
1 changed files with 7 additions and 3 deletions
|
@ -6,11 +6,8 @@ package util
|
|||
|
||||
import (
|
||||
"encoding/hex"
|
||||
"os"
|
||||
"os/exec"
|
||||
"regexp"
|
||||
"sort"
|
||||
"strings"
|
||||
)
|
||||
|
||||
var isHexa = regexp.MustCompile("^[0-9A-Fa-f]+$")
|
||||
|
@ -38,3 +35,10 @@ func RemoveDuplicate[T comparable](inlist []T) []T {
|
|||
}
|
||||
return list
|
||||
}
|
||||
|
||||
func InSlice(item string, slice []string) bool {
|
||||
sort.Strings(slice)
|
||||
i := sort.SearchStrings(slice, item)
|
||||
return i < len(slice) && slice[i] == item
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue