Move printLogs from oci.go to sandbox.go

It's not OCI-specific, so it makes more sense in the file that exports
it to the world.

Signed-off-by: Paul "TBBle" Hampson <Paul.Hampson@Pobox.com>
v0.8
Paul "TBBle" Hampson 2020-03-01 22:48:30 +11:00
parent 25f50eb711
commit 7369864344
2 changed files with 10 additions and 12 deletions

View File

@ -1,8 +1,6 @@
package integration
import (
"bufio"
"bytes"
"fmt"
"log"
"os"
@ -68,13 +66,3 @@ func (s *oci) New(cfg *BackendConfig) (Backend, func() error, error) {
rootless: s.uid != 0,
}, stop, nil
}
func printLogs(logs map[string]*bytes.Buffer, f func(args ...interface{})) {
for name, l := range logs {
f(name)
s := bufio.NewScanner(l)
for s.Scan() {
f(s.Text())
}
}
}

View File

@ -212,3 +212,13 @@ func rootlessSupported(uid int) bool {
}
return true
}
func printLogs(logs map[string]*bytes.Buffer, f func(args ...interface{})) {
for name, l := range logs {
f(name)
s := bufio.NewScanner(l)
for s.Scan() {
f(s.Text())
}
}
}