Files
gocryptotrader/cmd/dbseed/main.go
Adrian Gallagher 9a4eb9de84 CI: Fix golangci-lint linter issues, add prealloc linter and bump version depends for Go 1.18 (#915)
* Bump CI versions

* Specifically set go version as 1.17.x bumps it to 1.18

* Another

* Adjust AppVeyor

* Part 1 of linter issues

* Part 2

* Fix various linters and improvements

* Part 3

* Finishing touches

* Tests and EqualFold

* Fix nitterinos plus bonus requester jobs bump for exchanges with large number of tests

* Fix nitterinos and bump golangci-lint timeout for AppVeyor

* Address nits, ensure all books are returned on err due to syncer regression

* Fix the wiggins

* Fix duplication

* Fix nitterinos
2022-04-20 13:45:15 +10:00

67 lines
1.2 KiB
Go

package main
import (
"fmt"
"log"
"os"
"github.com/thrasher-corp/gocryptotrader/config"
"github.com/thrasher-corp/gocryptotrader/core"
"github.com/urfave/cli/v2"
)
var (
app = &cli.App{
Name: "dbseed",
Version: core.Version(false),
EnableBashCompletion: true,
Flags: []cli.Flag{
&cli.StringFlag{
Name: "config",
Value: config.DefaultFilePath(),
Usage: "config file to load",
Destination: &configFile,
},
&cli.BoolFlag{
Name: "verbose",
Usage: "toggle verbose output",
Destination: &verbose,
},
},
Commands: []*cli.Command{
seedExchangeCommand,
seedCandleCommand,
},
}
workingDir string
configFile string
verbose bool
)
func main() {
var err error
workingDir, err = os.Getwd()
if err != nil {
log.Println("error getting current working path")
workingDir = "."
}
fmt.Println("GoCryptoTrader database seeding tool")
fmt.Println(core.Copyright)
fmt.Println()
err = app.Run(os.Args)
if err != nil {
log.Fatal(err)
}
if dbConn != nil {
if dbConn.SQL != nil {
err = dbConn.SQL.Close()
if err != nil {
log.Println(err)
}
}
}
}