From f4f6e0076e771cedcca340e072cd1813dc91a89c Mon Sep 17 00:00:00 2001 From: Steven Powell Date: Tue, 1 Oct 2024 15:28:44 -0700 Subject: [PATCH] Fix long lines in lastStart.txt not outputting in log outputs --- pkg/minikube/logs/logs.go | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) 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.