Files
gocryptotrader/cmd/gctcli/helpers.go
Adrian Gallagher f0d45aa1d2 golangci-lint/CI: Bump versions and introduce new linters (#798)
* golangci-lint/CI: Bump versions

Fix remaining linter issues

* Specifically set AppVeyor version

* Fix the infamous typos 👀

* Add go env cmd to AppVeyor

* Add go version cmd to AppVeyor

* Specify AppVeyor image, adjust linters

* Update go get to go install due to deprecation

* Bump golangci-lint timeout time for AppVeyor

* Change NW contract to NQ

* Address nitters

* GetRandomPair -> Pair{}

* Address nits

* Address time nitterinos plus additional tweaks

* More time inception upgrades!

* Bending time and space
2021-10-14 16:38:53 +11:00

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()
}
}