Make podman ps fast

Like Ricky Bobby, we want to go fast.

Signed-off-by: baude <bbaude@redhat.com>
This commit is contained in:
baude
2018-10-10 12:22:35 -05:00
parent 5b2478ed87
commit ee8f19e7be
11 changed files with 429 additions and 256 deletions

View File

@ -315,8 +315,14 @@ func (s *PodmanSession) OutputToString() string {
// OutputToStringArray returns the output as a []string
// where each array item is a line split by newline
func (s *PodmanSession) OutputToStringArray() []string {
var results []string
output := fmt.Sprintf("%s", s.Out.Contents())
return strings.Split(output, "\n")
for _, line := range strings.Split(output, "\n") {
if line != "" {
results = append(results, line)
}
}
return results
}
// ErrorGrepString takes session stderr output and behaves like grep. it returns a bool