mirror of
https://github.com/vmware-tanzu/pinniped.git
synced 2026-02-08 05:50:30 +00:00
Refactor logLines to SplitByNewline, deduplicate
This commit is contained in:
14
internal/testutil/stringutil/stringutil.go
Normal file
14
internal/testutil/stringutil/stringutil.go
Normal file
@@ -0,0 +1,14 @@
|
||||
// Copyright 2024 the Pinniped contributors. All Rights Reserved.
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
package stringutil
|
||||
|
||||
import "strings"
|
||||
|
||||
func SplitByNewline(logs string) []string {
|
||||
if len(logs) == 0 {
|
||||
return nil
|
||||
}
|
||||
|
||||
return strings.Split(strings.TrimSpace(logs), "\n")
|
||||
}
|
||||
Reference in New Issue
Block a user