Skip to content

Commit

Permalink
fix(internal.fast): no color in windows
Browse files Browse the repository at this point in the history
  • Loading branch information
adhocore committed May 4, 2021
1 parent d61ab24 commit a429138
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions internal/fast/fast.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import (
"context"
"fmt"
"log"
"os"
"time"

"github.com/chromedp/cdproto/emulation"
Expand Down Expand Up @@ -57,6 +58,15 @@ func Run() {
log.Fatal(err)
}

if os.PathSeparator == '\\' {
fmt.Printf("download speed: %s %s\n", fast.Down, fast.DownUnit)
fmt.Printf("upload speed: %s %s\n", fast.Up, fast.UpUnit)
fmt.Printf("\n")
fmt.Printf("> took: %f secs\n", time.Since(start).Seconds())

return
}

fmt.Printf("\033[36mdownload speed:\033[m \033[32m%s\033[m %s\n", fast.Down, fast.DownUnit)
fmt.Printf("\033[36mupload speed:\033[m \033[31m%s\033[m %s\n", fast.Up, fast.UpUnit)
fmt.Printf("\n")
Expand Down

0 comments on commit a429138

Please sign in to comment.