Files
gocryptotrader/cmd/gctcli/helpers.go
Adrian Gallagher 7ebc392532 build/linters: Bump Go to v1.25 and golangci-lint to v2.4.0 (#2005)
* build/linters: Bump Go to v1.25 and golangci-lint to v2.4.0

* refactor: Update TODO comments for net.Listen and net.DialTimeout; improve variable naming in websocket and exchange methods

* refactor: Rename massageMissingData to backfillMissingData for clarity and update references in RSI and MFI calculations

* fix: Correct typo in TODO comment for net.Listen in RPC server
2025-08-20 11:55:15 +10:00

43 lines
767 B
Go

package main
import (
"context"
"fmt"
"os"
"os/exec"
"runtime"
"google.golang.org/grpc"
)
var (
// use these to change text colours in CMD output
redText = "\033[38;5;203m"
greenText = "\033[38;5;157m"
whiteText = "\033[38;5;255m"
grayText = "\033[38;5;243m"
defaultText = "\u001b[0m"
)
func clearScreen() error {
switch runtime.GOOS {
case "windows":
cmd := exec.CommandContext(context.TODO(), "cmd", "/c", "cls")
cmd.Stdout = os.Stdout
return cmd.Run()
default:
cmd := exec.CommandContext(context.TODO(), "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()
}
}