fix a potential tabwriter panic (#49)

use tabwriter's native write for:
- sometimes tabwriter panic with goroutine
- goroutine with fmt.Fprintf cause dirty data
This commit is contained in:
mrfly 2017-12-09 04:28:06 +08:00 committed by Jess Frazelle
parent 29f6d2fab9
commit cb41c7a396

View file

@ -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)
}