mirror of
https://github.com/c9s/bbgo.git
synced 2024-11-21 22:43:52 +00:00
if dotenv file does not exist, do not load it
This commit is contained in:
parent
bd895149ad
commit
dbfc1caa53
|
@ -19,11 +19,15 @@ import (
|
|||
|
||||
func main() {
|
||||
dotenvFile := ".env.local"
|
||||
if err := godotenv.Load(dotenvFile); err != nil {
|
||||
log.WithError(err).Error("error loading dotenv file")
|
||||
return
|
||||
|
||||
if _, err := os.Stat(dotenvFile) ; err == nil {
|
||||
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")
|
||||
|
|
Loading…
Reference in New Issue
Block a user