mirror of
https://github.com/k8sgpt-ai/k8sgpt.git
synced 2025-09-13 05:40:42 +00:00
refactor: replace util.SliceContainsString with slices.Contains & make fmt (#1041)
* use std package's func instead Signed-off-by: gang.liu <gang.liu@daocloud.io> * refactor: replace util.SliceContainsString with slices.Contains & make fmt Signed-off-by: gang.liu <gang.liu@daocloud.io> --------- Signed-off-by: gang.liu <gang.liu@daocloud.io> Co-authored-by: Alex Jones <alexsimonjones@gmail.com>
This commit is contained in:
@@ -26,29 +26,6 @@ import (
|
||||
"k8s.io/client-go/kubernetes/fake"
|
||||
)
|
||||
|
||||
func TestSliceContainsString(t *testing.T) {
|
||||
tests := []struct {
|
||||
slice []string
|
||||
s string
|
||||
expected bool
|
||||
}{
|
||||
{
|
||||
expected: false,
|
||||
},
|
||||
{
|
||||
slice: []string{"temp", "value"},
|
||||
s: "value",
|
||||
expected: true,
|
||||
},
|
||||
}
|
||||
for _, tt := range tests {
|
||||
tt := tt
|
||||
t.Run(tt.s, func(t *testing.T) {
|
||||
require.Equal(t, tt.expected, SliceContainsString(tt.slice, tt.s))
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
func TestGetParent(t *testing.T) {
|
||||
ownerName := "test-name"
|
||||
namespace := "test"
|
||||
@@ -409,6 +386,7 @@ func TestGetPodListByLabels(t *testing.T) {
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
func TestFileExists(t *testing.T) {
|
||||
tests := []struct {
|
||||
filePath string
|
||||
|
Reference in New Issue
Block a user