github.com/fatih/color: patch to remove race condition...
when printing to a Pipe. When unpatched, Site: 哔哩哔哩 bilibili.com Title: ... Type: video Stream: [64] ------------------- Quality: 高清 720P Size: 91.35 MiB (95783022 Bytes) # download with: annie -f 64 ... is instead printed as Site: Title: Type: Stream: [64] ------------------- Quality: Size: # download with: 哔哩哔哩 bilibili.com ... video 高清 720P 91.35 MiB (95783022 Bytes) annie -f 64 ...
This commit is contained in:
parent
f4850a6ba0
commit
81ee0f1dce
9
vendor/github.com/fatih/color/color.go
generated
vendored
9
vendor/github.com/fatih/color/color.go
generated
vendored
@ -204,7 +204,8 @@ func (c *Color) Print(a ...interface{}) (n int, err error) {
|
||||
c.Set()
|
||||
defer c.unset()
|
||||
|
||||
return fmt.Fprint(Output, a...)
|
||||
return fmt.Print(a...)
|
||||
// return fmt.Fprint(Output, a...)
|
||||
}
|
||||
|
||||
// Fprintf formats according to a format specifier and writes to w.
|
||||
@ -225,7 +226,8 @@ func (c *Color) Printf(format string, a ...interface{}) (n int, err error) {
|
||||
c.Set()
|
||||
defer c.unset()
|
||||
|
||||
return fmt.Fprintf(Output, format, a...)
|
||||
return fmt.Printf(format, a...)
|
||||
// return fmt.Fprintf(Output, format, a...)
|
||||
}
|
||||
|
||||
// Fprintln formats using the default formats for its operands and writes to w.
|
||||
@ -248,7 +250,8 @@ func (c *Color) Println(a ...interface{}) (n int, err error) {
|
||||
c.Set()
|
||||
defer c.unset()
|
||||
|
||||
return fmt.Fprintln(Output, a...)
|
||||
return fmt.Println(a...)
|
||||
// return fmt.Fprintln(Output, a...)
|
||||
}
|
||||
|
||||
// Sprint is just like Print, but returns a string instead of printing it.
|
||||
|
Loading…
x
Reference in New Issue
Block a user