Skip to content

Commit a429138

Browse files
committed
fix(internal.fast): no color in windows
1 parent d61ab24 commit a429138

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

internal/fast/fast.go

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import (
44
"context"
55
"fmt"
66
"log"
7+
"os"
78
"time"
89

910
"github.com/chromedp/cdproto/emulation"
@@ -57,6 +58,15 @@ func Run() {
5758
log.Fatal(err)
5859
}
5960

61+
if os.PathSeparator == '\\' {
62+
fmt.Printf("download speed: %s %s\n", fast.Down, fast.DownUnit)
63+
fmt.Printf("upload speed: %s %s\n", fast.Up, fast.UpUnit)
64+
fmt.Printf("\n")
65+
fmt.Printf("> took: %f secs\n", time.Since(start).Seconds())
66+
67+
return
68+
}
69+
6070
fmt.Printf("\033[36mdownload speed:\033[m \033[32m%s\033[m %s\n", fast.Down, fast.DownUnit)
6171
fmt.Printf("\033[36mupload speed:\033[m \033[31m%s\033[m %s\n", fast.Up, fast.UpUnit)
6272
fmt.Printf("\n")

0 commit comments

Comments
 (0)