mirror of
https://github.com/fatih/color.git
synced 2024-11-24 08:02:14 +02:00
32 lines
435 B
Go
32 lines
435 B
Go
|
package color
|
||
|
|
||
|
import (
|
||
|
"bufio"
|
||
|
"fmt"
|
||
|
"os"
|
||
|
"time"
|
||
|
|
||
|
"testing"
|
||
|
)
|
||
|
|
||
|
func TestColor(t *testing.T) {
|
||
|
go func() {
|
||
|
scanner := bufio.NewScanner(os.Stdout)
|
||
|
for scanner.Scan() {
|
||
|
fmt.Println(scanner.Text()) // Println will add back the final '\n'
|
||
|
}
|
||
|
}()
|
||
|
|
||
|
time.Sleep(time.Millisecond * 300)
|
||
|
|
||
|
c := Cyan.Bold()
|
||
|
c.Println("ankara")
|
||
|
|
||
|
// New(FgGreen, Bold).Begin()
|
||
|
// fmt.Println("san francisco")
|
||
|
// End()
|
||
|
|
||
|
// Output:
|
||
|
// ankara
|
||
|
}
|