diff --git a/pkg/minikube/logs/logs.go b/pkg/minikube/logs/logs.go index bcb3f4b13f2d..c54ce8da6767 100644 --- a/pkg/minikube/logs/logs.go +++ b/pkg/minikube/logs/logs.go @@ -234,15 +234,21 @@ func OutputLastStart() error { } defer f.Close() l := "" - s := bufio.NewScanner(f) - for s.Scan() { - l += s.Text() + "\n" + r := bufio.NewReader(f) + var s string + for { + s, err = r.ReadString('\n') + if err != nil { + break + } + l += s } out.Styled(style.None, l) - if err := s.Err(); err != nil { - return fmt.Errorf("failed to read file %s: %v", fp, err) + if err == io.EOF { + return nil } - return nil + + return fmt.Errorf("failed to read file %s: %v", fp, err) } // OutputOffline outputs logs that don't need a running cluster.