mirror of
https://github.com/d0zingcat/gocryptotrader.git
synced 2026-05-13 23:16:45 +00:00
Moved ticker fetching from main into the relative exchange.
This commit is contained in:
257
main.go
257
main.go
@@ -2,10 +2,8 @@ package main
|
||||
|
||||
import (
|
||||
"log"
|
||||
"time"
|
||||
"os"
|
||||
"errors"
|
||||
"os/exec"
|
||||
"os/signal"
|
||||
"syscall"
|
||||
)
|
||||
@@ -28,32 +26,11 @@ type Exchange struct {
|
||||
type Bot struct {
|
||||
config Config
|
||||
exchange Exchange
|
||||
shutdown chan bool
|
||||
}
|
||||
|
||||
var bot Bot
|
||||
|
||||
func HandleInterrupt() {
|
||||
c := make(chan os.Signal, 1)
|
||||
signal.Notify(c, os.Interrupt, syscall.SIGTERM)
|
||||
go func() {
|
||||
sig := <-c
|
||||
log.Printf("Captured %v.", sig)
|
||||
Shutdown()
|
||||
log.Println("Exiting.")
|
||||
os.Exit(1)
|
||||
}()
|
||||
}
|
||||
|
||||
func Shutdown() {
|
||||
err := SaveConfig()
|
||||
|
||||
if err != nil {
|
||||
log.Println("Unable to save config.")
|
||||
}
|
||||
|
||||
log.Println("Config file saved successfully.")
|
||||
}
|
||||
|
||||
func main() {
|
||||
HandleInterrupt()
|
||||
log.Println("Loading config file config.json..")
|
||||
@@ -115,6 +92,12 @@ func main() {
|
||||
bot.exchange.lakebtc.SetDefaults()
|
||||
bot.exchange.huobi.SetDefaults()
|
||||
|
||||
err = RetrieveConfigCurrencyPairs(bot.config)
|
||||
|
||||
if err != nil {
|
||||
log.Println("Fatal error retrieving config currency pairs. Error: ", err)
|
||||
}
|
||||
|
||||
for _, exch := range bot.config.Exchanges {
|
||||
if bot.exchange.btcchina.GetName() == exch.Name {
|
||||
if !exch.Enabled {
|
||||
@@ -123,10 +106,12 @@ func main() {
|
||||
} else {
|
||||
log.Printf("%s enabled.\n", exch.Name)
|
||||
bot.exchange.btcchina.SetAPIKeys(exch.APIKey, exch.APISecret)
|
||||
go bot.exchange.btcchina.Run()
|
||||
|
||||
if exch.Verbose {
|
||||
bot.exchange.btcchina.Verbose = true
|
||||
log.Printf("%s Verbose output enabled.\n", exch.Name)
|
||||
go bot.exchange.btcchina.Run()
|
||||
} else {
|
||||
log.Printf("%s Verbose output disabled.\n", exch.Name)
|
||||
}
|
||||
@@ -138,7 +123,7 @@ func main() {
|
||||
} else {
|
||||
log.Printf("%s enabled.\n", exch.Name)
|
||||
bot.exchange.bitstamp.SetAPIKeys(exch.ClientID, exch.APIKey, exch.APISecret)
|
||||
bot.exchange.bitstamp.GetBalance()
|
||||
go bot.exchange.bitstamp.Run()
|
||||
|
||||
if exch.Verbose {
|
||||
bot.exchange.bitstamp.Verbose = true
|
||||
@@ -154,6 +139,7 @@ func main() {
|
||||
} else {
|
||||
log.Printf("%s enabled.\n", exch.Name)
|
||||
bot.exchange.bitfinex.SetAPIKeys(exch.APIKey, exch.APISecret)
|
||||
go bot.exchange.bitfinex.Run()
|
||||
|
||||
if exch.Verbose {
|
||||
bot.exchange.bitfinex.Verbose = true
|
||||
@@ -161,8 +147,6 @@ func main() {
|
||||
} else {
|
||||
log.Printf("%s Verbose output disabled.\n", exch.Name)
|
||||
}
|
||||
bot.exchange.bitfinex.GetAccountFeeInfo()
|
||||
bot.exchange.bitfinex.GetAccountBalance()
|
||||
}
|
||||
} else if bot.exchange.btce.GetName() == exch.Name {
|
||||
if !exch.Enabled {
|
||||
@@ -171,6 +155,7 @@ func main() {
|
||||
} else {
|
||||
log.Printf("%s enabled.\n", exch.Name)
|
||||
bot.exchange.btce.SetAPIKeys(exch.APIKey, exch.APISecret)
|
||||
go bot.exchange.btce.Run()
|
||||
|
||||
if exch.Verbose {
|
||||
bot.exchange.btce.Verbose = true
|
||||
@@ -186,6 +171,7 @@ func main() {
|
||||
} else {
|
||||
log.Printf("%s enabled.\n", exch.Name)
|
||||
bot.exchange.btcmarkets.SetAPIKeys(exch.APIKey, exch.APISecret)
|
||||
go bot.exchange.btcmarkets.Run()
|
||||
|
||||
if exch.Verbose {
|
||||
bot.exchange.btcmarkets.Verbose = true
|
||||
@@ -201,6 +187,7 @@ func main() {
|
||||
} else {
|
||||
log.Printf("%s enabled.\n", exch.Name)
|
||||
bot.exchange.coinbase.SetAPIKeys(exch.ClientID, exch.APIKey, exch.APISecret)
|
||||
go bot.exchange.coinbase.Run()
|
||||
|
||||
if exch.Verbose {
|
||||
bot.exchange.coinbase.Verbose = true
|
||||
@@ -216,6 +203,7 @@ func main() {
|
||||
} else {
|
||||
log.Printf("%s enabled.\n", exch.Name)
|
||||
bot.exchange.okcoinChina.SetAPIKeys(exch.APIKey, exch.APISecret)
|
||||
go bot.exchange.okcoinChina.Run()
|
||||
|
||||
if exch.Verbose {
|
||||
bot.exchange.okcoinChina.Verbose = true
|
||||
@@ -231,6 +219,7 @@ func main() {
|
||||
} else {
|
||||
log.Printf("%s enabled.\n", exch.Name)
|
||||
bot.exchange.okcoinIntl.SetAPIKeys(exch.APIKey, exch.APISecret)
|
||||
go bot.exchange.okcoinIntl.Run()
|
||||
|
||||
if exch.Verbose {
|
||||
bot.exchange.okcoinIntl.Verbose = true
|
||||
@@ -246,6 +235,7 @@ func main() {
|
||||
} else {
|
||||
log.Printf("%s enabled.\n", exch.Name)
|
||||
bot.exchange.itbit.SetAPIKeys(exch.APIKey, exch.APISecret)
|
||||
go bot.exchange.itbit.Run()
|
||||
|
||||
if exch.Verbose {
|
||||
bot.exchange.itbit.Verbose = true
|
||||
@@ -261,6 +251,7 @@ func main() {
|
||||
} else {
|
||||
log.Printf("%s enabled.\n", exch.Name)
|
||||
bot.exchange.kraken.SetAPIKeys(exch.APIKey, exch.APISecret)
|
||||
go bot.exchange.kraken.Run()
|
||||
|
||||
if exch.Verbose {
|
||||
bot.exchange.kraken.Verbose = true
|
||||
@@ -276,6 +267,7 @@ func main() {
|
||||
} else {
|
||||
log.Printf("%s enabled.\n", exch.Name)
|
||||
bot.exchange.lakebtc.SetAPIKeys(exch.APIKey, exch.APISecret)
|
||||
go bot.exchange.lakebtc.Run()
|
||||
|
||||
if exch.Verbose {
|
||||
bot.exchange.lakebtc.Verbose = true
|
||||
@@ -291,6 +283,7 @@ func main() {
|
||||
} else {
|
||||
log.Printf("%s enabled.\n", exch.Name)
|
||||
bot.exchange.huobi.SetAPIKeys(exch.APIKey, exch.APISecret)
|
||||
go bot.exchange.huobi.Run()
|
||||
|
||||
if exch.Verbose {
|
||||
bot.exchange.huobi.Verbose = true
|
||||
@@ -301,196 +294,30 @@ func main() {
|
||||
}
|
||||
}
|
||||
}
|
||||
<-bot.shutdown
|
||||
Shutdown()
|
||||
}
|
||||
|
||||
err = RetrieveConfigCurrencyPairs(bot.config)
|
||||
func HandleInterrupt() {
|
||||
c := make(chan os.Signal, 1)
|
||||
signal.Notify(c, os.Interrupt, syscall.SIGTERM)
|
||||
go func() {
|
||||
sig := <-c
|
||||
log.Printf("Captured %v.", sig)
|
||||
Shutdown()
|
||||
}()
|
||||
}
|
||||
|
||||
func Shutdown() {
|
||||
log.Println("Bot shutting down..")
|
||||
err := SaveConfig()
|
||||
|
||||
if err != nil {
|
||||
log.Println("Fatal error retrieving config currency pairs. Error: ", err)
|
||||
log.Println("Unable to save config.")
|
||||
} else {
|
||||
log.Println("Config file saved successfully.")
|
||||
}
|
||||
|
||||
//temp until proper asynchronous method of getting pricing/order books is coded
|
||||
for {
|
||||
//spot
|
||||
if bot.exchange.coinbase.IsEnabled() {
|
||||
go func() {
|
||||
CoinbaseStats := bot.exchange.coinbase.GetStats("BTC-USD")
|
||||
CoinbaseTicker := bot.exchange.coinbase.GetTicker("BTC-USD")
|
||||
log.Printf("Coinbase BTC: Last %f High %f Low %f Volume %f\n", CoinbaseTicker.Price, CoinbaseStats.High, CoinbaseStats.Low, CoinbaseStats.Volume)
|
||||
}()
|
||||
}
|
||||
if bot.exchange.kraken.IsEnabled() {
|
||||
go func() {
|
||||
KrakenBTC := bot.exchange.kraken.GetTicker("XBTUSD")
|
||||
log.Printf("Kraken BTC: %v\n", KrakenBTC)
|
||||
}()
|
||||
go func() {
|
||||
KrakenLTC := bot.exchange.kraken.GetTicker("LTCUSD")
|
||||
log.Printf("Kraken LTC: %v\n", KrakenLTC)
|
||||
}()
|
||||
}
|
||||
if bot.exchange.lakebtc.IsEnabled() {
|
||||
go func() {
|
||||
LakeBTCTickerResponse := bot.exchange.lakebtc.GetTicker()
|
||||
log.Printf("LakeBTC USD: Last %f (%f) High %f (%f) Low %f (%f) Volume US %f (CNY %f)\n", LakeBTCTickerResponse.USD.Last, LakeBTCTickerResponse.CNY.Last, LakeBTCTickerResponse.USD.High, LakeBTCTickerResponse.CNY.High, LakeBTCTickerResponse.USD.Low, LakeBTCTickerResponse.CNY.Low, LakeBTCTickerResponse.USD.Volume, LakeBTCTickerResponse.CNY.Volume)
|
||||
}()
|
||||
}
|
||||
if bot.exchange.btcchina.IsEnabled() {
|
||||
go func() {
|
||||
BTCChinaBTC := bot.exchange.btcchina.GetTicker("btccny")
|
||||
BTCChinaBTCLastUSD, _ := ConvertCurrency(BTCChinaBTC.Last, "CNY", "USD")
|
||||
BTCChinaBTCHighUSD, _ := ConvertCurrency(BTCChinaBTC.High, "CNY", "USD")
|
||||
BTCChinaBTCLowUSD, _ := ConvertCurrency(BTCChinaBTC.Low, "CNY", "USD")
|
||||
log.Printf("BTCChina BTC: Last %f (%f) High %f (%f) Low %f (%f) Volume %f\n", BTCChinaBTCLastUSD, BTCChinaBTC.Last, BTCChinaBTCHighUSD, BTCChinaBTC.High, BTCChinaBTCLowUSD, BTCChinaBTC.Low, BTCChinaBTC.Vol)
|
||||
}()
|
||||
|
||||
|
||||
go func() {
|
||||
BTCChinaLTC := bot.exchange.btcchina.GetTicker("ltccny")
|
||||
BTCChinaLTCLastUSD, _ := ConvertCurrency(BTCChinaLTC.Last, "CNY", "USD")
|
||||
BTCChinaLTCHighUSD, _ := ConvertCurrency(BTCChinaLTC.High, "CNY", "USD")
|
||||
BTCChinaLTCLowUSD, _ := ConvertCurrency(BTCChinaLTC.Low, "CNY", "USD")
|
||||
log.Printf("BTCChina LTC: Last %f (%f) High %f (%f) Low %f (%f) Volume %f\n", BTCChinaLTCLastUSD, BTCChinaLTC.Last, BTCChinaLTCHighUSD, BTCChinaLTC.High, BTCChinaLTCLowUSD, BTCChinaLTC.Low, BTCChinaLTC.Vol)
|
||||
}()
|
||||
}
|
||||
|
||||
if bot.exchange.huobi.IsEnabled() {
|
||||
go func() {
|
||||
HuobiBTC := bot.exchange.huobi.GetTicker("btc")
|
||||
HuobiBTCLastUSD, _ := ConvertCurrency(HuobiBTC.Last, "CNY", "USD")
|
||||
HuobiBTCHighUSD, _ := ConvertCurrency(HuobiBTC.High, "CNY", "USD")
|
||||
HuobiBTCLowUSD, _ := ConvertCurrency(HuobiBTC.Low, "CNY", "USD")
|
||||
log.Printf("Huobi BTC: Last %f (%f) High %f (%f) Low %f (%f) Volume %f\n", HuobiBTCLastUSD, HuobiBTC.Last, HuobiBTCHighUSD, HuobiBTC.High, HuobiBTCLowUSD, HuobiBTC.Low, HuobiBTC.Vol)
|
||||
}()
|
||||
|
||||
go func() {
|
||||
HuobiLTC := bot.exchange.huobi.GetTicker("ltc")
|
||||
HuobiLTCLastUSD, _ := ConvertCurrency(HuobiLTC.Last, "CNY", "USD")
|
||||
HuobiLTCHighUSD, _ := ConvertCurrency(HuobiLTC.High, "CNY", "USD")
|
||||
HuobiLTCLowUSD, _ := ConvertCurrency(HuobiLTC.Low, "CNY", "USD")
|
||||
log.Printf("Huobi LTC: Last %f (%f) High %f (%f) Low %f (%f) Volume %f\n", HuobiLTCLastUSD, HuobiLTC.Last, HuobiLTCHighUSD, HuobiLTC.High, HuobiLTCLowUSD, HuobiLTC.Low, HuobiLTC.Vol)
|
||||
}()
|
||||
}
|
||||
|
||||
if bot.exchange.itbit.IsEnabled() {
|
||||
go func() {
|
||||
ItbitBTC := bot.exchange.itbit.GetTicker("XBTUSD")
|
||||
log.Printf("ItBit BTC: Last %f High %f Low %f Volume %f\n", ItbitBTC.LastPrice, ItbitBTC.High24h, ItbitBTC.Low24h, ItbitBTC.Volume24h)
|
||||
}()
|
||||
}
|
||||
|
||||
if bot.exchange.bitstamp.IsEnabled() {
|
||||
go func() {
|
||||
BitstampBTC := bot.exchange.bitstamp.GetTicker()
|
||||
log.Printf("Bitstamp BTC: Last %f High %f Low %f Volume %f\n", BitstampBTC.Last, BitstampBTC.High, BitstampBTC.Low, BitstampBTC.Volume)
|
||||
}()
|
||||
}
|
||||
|
||||
if bot.exchange.bitfinex.IsEnabled() {
|
||||
go func() {
|
||||
BitfinexLTC := bot.exchange.bitfinex.GetTicker("ltcusd")
|
||||
log.Printf("Bitfinex LTC: Last %f High %f Low %f Volume %f\n", BitfinexLTC.Last, BitfinexLTC.High, BitfinexLTC.Low, BitfinexLTC.Volume)
|
||||
}()
|
||||
|
||||
go func() {
|
||||
BitfinexBTC := bot.exchange.bitfinex.GetTicker("btcusd")
|
||||
log.Printf("Bitfinex BTC: Last %f High %f Low %f Volume %f\n", BitfinexBTC.Last, BitfinexBTC.High, BitfinexBTC.Low, BitfinexBTC.Volume)
|
||||
}()
|
||||
}
|
||||
|
||||
if bot.exchange.btce.IsEnabled() {
|
||||
go func() {
|
||||
BTCeBTC := bot.exchange.btce.GetTicker("btc_usd")
|
||||
log.Printf("BTC-e BTC: Last %f High %f Low %f Volume %f\n", BTCeBTC.Last, BTCeBTC.High, BTCeBTC.Low, BTCeBTC.Vol_cur)
|
||||
}()
|
||||
|
||||
go func() {
|
||||
BTCeLTC := bot.exchange.btce.GetTicker("ltc_usd")
|
||||
log.Printf("BTC-e LTC: Last %f High %f Low %f Volume %f\n", BTCeLTC.Last, BTCeLTC.High, BTCeLTC.Low, BTCeLTC.Vol_cur)
|
||||
}()
|
||||
}
|
||||
|
||||
if bot.exchange.btcmarkets.IsEnabled() {
|
||||
go func() {
|
||||
BTCMarketsBTC := bot.exchange.btcmarkets.GetTicker("BTC")
|
||||
BTCMarketsBTCLastUSD, _ := ConvertCurrency(BTCMarketsBTC.LastPrice, "AUD", "USD")
|
||||
BTCMarketsBTCBestBidUSD, _ := ConvertCurrency(BTCMarketsBTC.BestBID, "AUD", "USD")
|
||||
BTCMarketsBTCBestAskUSD, _ := ConvertCurrency(BTCMarketsBTC.BestAsk, "AUD", "USD")
|
||||
log.Printf("BTC Markets BTC: Last %f (%f) Bid %f (%f) Ask %f (%f)\n", BTCMarketsBTCLastUSD, BTCMarketsBTC.LastPrice, BTCMarketsBTCBestBidUSD, BTCMarketsBTC.BestBID, BTCMarketsBTCBestAskUSD, BTCMarketsBTC.BestAsk)
|
||||
}()
|
||||
|
||||
go func() {
|
||||
BTCMarketsLTC := bot.exchange.btcmarkets.GetTicker("LTC")
|
||||
BTCMarketsLTCLastUSD, _ := ConvertCurrency(BTCMarketsLTC.LastPrice, "AUD", "USD")
|
||||
BTCMarketsLTCBestBidUSD, _ := ConvertCurrency(BTCMarketsLTC.BestBID, "AUD", "USD")
|
||||
BTCMarketsLTCBestAskUSD, _ := ConvertCurrency(BTCMarketsLTC.BestAsk, "AUD", "USD")
|
||||
log.Printf("BTC Markets LTC: Last %f (%f) Bid %f (%f) Ask %f (%f)", BTCMarketsLTCLastUSD, BTCMarketsLTC.LastPrice, BTCMarketsLTCBestBidUSD, BTCMarketsLTC.BestBID, BTCMarketsLTCBestAskUSD, BTCMarketsLTC.BestAsk)
|
||||
}()
|
||||
}
|
||||
|
||||
if bot.exchange.okcoinChina.IsEnabled() {
|
||||
go func() {
|
||||
OKCoinChinaBTC := bot.exchange.okcoinChina.GetTicker("btc_cny")
|
||||
OKCoinChinaBTCLastUSD, _ := ConvertCurrency(OKCoinChinaBTC.Last, "CNY", "USD")
|
||||
OKCoinChinaBTCHighUSD, _ := ConvertCurrency(OKCoinChinaBTC.High, "CNY", "USD")
|
||||
OKCoinChinaBTCLowUSD, _ := ConvertCurrency(OKCoinChinaBTC.Low, "CNY", "USD")
|
||||
log.Printf("OKCoin China: Last %f (%f) High %f (%f) Low %f (%f) Volume %f\n", OKCoinChinaBTCLastUSD, OKCoinChinaBTC.Last, OKCoinChinaBTCHighUSD, OKCoinChinaBTC.High, OKCoinChinaBTCLowUSD, OKCoinChinaBTC.Low, OKCoinChinaBTC.Vol)
|
||||
}()
|
||||
|
||||
go func() {
|
||||
OKCoinChinaLTC := bot.exchange.okcoinChina.GetTicker("ltc_cny")
|
||||
OKCoinChinaLTCLastUSD, _ := ConvertCurrency(OKCoinChinaLTC.Last, "CNY", "USD")
|
||||
OKCoinChinaLTCHighUSD, _ := ConvertCurrency(OKCoinChinaLTC.High, "CNY", "USD")
|
||||
OKCoinChinaLTCLowUSD, _ := ConvertCurrency(OKCoinChinaLTC.Low, "CNY", "USD")
|
||||
log.Printf("OKCoin China: Last %f (%f) High %f (%f) Low %f (%f) Volume %f\n", OKCoinChinaLTCLastUSD, OKCoinChinaLTC.Last, OKCoinChinaLTCHighUSD, OKCoinChinaLTC.High, OKCoinChinaLTCLowUSD, OKCoinChinaLTC.Low, OKCoinChinaLTC.Vol)
|
||||
}()
|
||||
}
|
||||
|
||||
if bot.exchange.okcoinIntl.IsEnabled() {
|
||||
go func() {
|
||||
OKCoinChinaIntlBTC := bot.exchange.okcoinIntl.GetTicker("btc_usd")
|
||||
log.Printf("OKCoin Intl BTC: Last %f High %f Low %f Volume %f\n", OKCoinChinaIntlBTC.Last, OKCoinChinaIntlBTC.High, OKCoinChinaIntlBTC.Low, OKCoinChinaIntlBTC.Vol)
|
||||
}()
|
||||
|
||||
go func() {
|
||||
OKCoinChinaIntlLTC := bot.exchange.okcoinIntl.GetTicker("ltc_usd")
|
||||
log.Printf("OKCoin Intl LTC: Last %f High %f Low %f Volume %f\n", OKCoinChinaIntlLTC.Last, OKCoinChinaIntlLTC.High, OKCoinChinaIntlLTC.Low, OKCoinChinaIntlLTC.Vol)
|
||||
}()
|
||||
|
||||
// futures
|
||||
go func() {
|
||||
OKCoinFuturesBTC := bot.exchange.okcoinIntl.GetFuturesTicker("btc_usd", "this_week")
|
||||
log.Printf("OKCoin BTC Futures (weekly): Last %f High %f Low %f Volume %f\n", OKCoinFuturesBTC.Last, OKCoinFuturesBTC.High, OKCoinFuturesBTC.Low, OKCoinFuturesBTC.Vol)
|
||||
}()
|
||||
|
||||
go func() {
|
||||
OKCoinFuturesBTC := bot.exchange.okcoinIntl.GetFuturesTicker("ltc_usd", "this_week")
|
||||
log.Printf("OKCoin LTC Futures (weekly): Last %f High %f Low %f Volume %f\n", OKCoinFuturesBTC.Last, OKCoinFuturesBTC.High, OKCoinFuturesBTC.Low, OKCoinFuturesBTC.Vol)
|
||||
}()
|
||||
|
||||
go func() {
|
||||
OKCoinFuturesBTC := bot.exchange.okcoinIntl.GetFuturesTicker("btc_usd", "next_week")
|
||||
log.Printf("OKCoin BTC Futures (biweekly): Last %f High %f Low %f Volume %f\n", OKCoinFuturesBTC.Last, OKCoinFuturesBTC.High, OKCoinFuturesBTC.Low, OKCoinFuturesBTC.Vol)
|
||||
}()
|
||||
|
||||
go func() {
|
||||
OKCoinFuturesBTC := bot.exchange.okcoinIntl.GetFuturesTicker("ltc_usd", "next_week")
|
||||
log.Printf("OKCoin LTC Futures (biweekly): Last %f High %f Low %f Volume %f\n", OKCoinFuturesBTC.Last, OKCoinFuturesBTC.High, OKCoinFuturesBTC.Low, OKCoinFuturesBTC.Vol)
|
||||
}()
|
||||
|
||||
go func() {
|
||||
OKCoinFuturesBTC := bot.exchange.okcoinIntl.GetFuturesTicker("btc_usd", "quarter")
|
||||
log.Printf("OKCoin BTC Futures (quarterly): Last %f High %f Low %f Volume %f\n", OKCoinFuturesBTC.Last, OKCoinFuturesBTC.High, OKCoinFuturesBTC.Low, OKCoinFuturesBTC.Vol)
|
||||
}()
|
||||
|
||||
go func() {
|
||||
OKCoinFuturesBTC := bot.exchange.okcoinIntl.GetFuturesTicker("ltc_usd", "quarter")
|
||||
log.Printf("OKCoin LTC Futures (quarterly): Last %f High %f Low %f Volume %f\n", OKCoinFuturesBTC.Last, OKCoinFuturesBTC.High, OKCoinFuturesBTC.Low, OKCoinFuturesBTC.Vol)
|
||||
}()
|
||||
}
|
||||
|
||||
time.Sleep(time.Second * 15)
|
||||
cmd := exec.Command("cmd", "/c", "cls")
|
||||
cmd.Stdout = os.Stdout
|
||||
cmd.Run()
|
||||
}
|
||||
}
|
||||
log.Println("Exiting.")
|
||||
os.Exit(1)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user