From cb41c7a396ca9673de0750ee8825ac777310318c Mon Sep 17 00:00:00 2001 From: mrfly Date: Sat, 9 Dec 2017 04:28:06 +0800 Subject: [PATCH] fix a potential tabwriter panic (#49) use tabwriter's native write for: - sometimes tabwriter panic with goroutine - goroutine with fmt.Fprintf cause dirty data --- main.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/main.go b/main.go index 7df71101..c77323ca 100644 --- a/main.go +++ b/main.go @@ -148,7 +148,8 @@ func main() { if err != nil { fmt.Printf("Get tags of [%s] error: %s", repo, err) } - fmt.Fprintf(w, "%s\t%s\n", repo, strings.Join(tags, ", ")) + out := fmt.Sprintf("%s\t%s\n", repo, strings.Join(tags, ", ")) + w.Write([]byte(out)) wg.Done() }(repo) }