mirror of
https://github.com/d0zingcat/gocryptotrader.git
synced 2026-05-13 23:16:45 +00:00
* fix rpc time parsing * Update cmd/gctcli/helpers.go Beautifully handled Co-authored-by: Adrian Gallagher <adrian.gallagher@thrasher.io> * Fixes combined commit * uses ParseInLocation, parse with timezone, remove helper functions * lint Co-authored-by: Adrian Gallagher <adrian.gallagher@thrasher.io>
34 lines
506 B
Go
34 lines
506 B
Go
package main
|
|
|
|
import (
|
|
"context"
|
|
"fmt"
|
|
"os"
|
|
"os/exec"
|
|
"runtime"
|
|
|
|
"google.golang.org/grpc"
|
|
)
|
|
|
|
func clearScreen() error {
|
|
switch runtime.GOOS {
|
|
case "windows":
|
|
cmd := exec.Command("cmd", "/c", "cls")
|
|
cmd.Stdout = os.Stdout
|
|
return cmd.Run()
|
|
default:
|
|
cmd := exec.Command("clear")
|
|
cmd.Stdout = os.Stdout
|
|
return cmd.Run()
|
|
}
|
|
}
|
|
|
|
func closeConn(conn *grpc.ClientConn, cancel context.CancelFunc) {
|
|
if err := conn.Close(); err != nil {
|
|
fmt.Println(err)
|
|
}
|
|
if cancel != nil {
|
|
cancel()
|
|
}
|
|
}
|