mirror of
https://github.com/c9s/bbgo.git
synced 2024-11-21 22:43:52 +00:00
load dotenv file
This commit is contained in:
parent
2365ccb5d8
commit
39fa0ef810
|
@ -7,6 +7,7 @@ import (
|
|||
"os/signal"
|
||||
"runtime"
|
||||
|
||||
"github.com/joho/godotenv"
|
||||
"github.com/zserge/lorca"
|
||||
|
||||
log "github.com/sirupsen/logrus"
|
||||
|
@ -17,6 +18,12 @@ import (
|
|||
)
|
||||
|
||||
func main() {
|
||||
dotenvFile := ".env.local"
|
||||
if err := godotenv.Load(dotenvFile); err != nil {
|
||||
log.WithError(err).Error("error loading dotenv file")
|
||||
return
|
||||
}
|
||||
|
||||
var args []string
|
||||
if runtime.GOOS == "linux" {
|
||||
args = append(args, "--class=bbgo")
|
||||
|
@ -46,7 +53,7 @@ func main() {
|
|||
// TODO: load the loading page html
|
||||
|
||||
// find a free port for binding the server
|
||||
ln, err := net.Listen("tcp", "127.0.0.1:9999")
|
||||
ln, err := net.Listen("tcp", "127.0.0.1:0")
|
||||
if err != nil {
|
||||
log.WithError(err).Error("can not bind listener")
|
||||
return
|
||||
|
|
Loading…
Reference in New Issue
Block a user