introduce --no-attach to ignore some service output

Signed-off-by: Nicolas De Loof <nicolas.deloof@gmail.com>
This commit is contained in:
Nicolas De Loof
2023-01-03 15:35:24 +01:00
committed by Nicolas De loof
parent 8b4ac37f9c
commit d5e4f00644
4 changed files with 31 additions and 0 deletions

View File

@@ -28,3 +28,14 @@ func Contains[T any](origin []T, element T) bool {
}
return false
}
// RemoveAll removes all elements from origin slice
func RemoveAll[T any](origin []T, elements []T) []T {
var filtered []T
for _, v := range origin {
if !Contains(elements, v) {
filtered = append(filtered, v)
}
}
return filtered
}