fathom/ana.go
Matthias Loibl 5824435243
Minor improvements to the Go code
* Don't log.Fatal if there's no .env, there won't be a .env if you run
with ENV variables
* Make the DSN multiline so it's easier to read
2016-12-25 16:24:40 +01:00

31 lines
479 B
Go

package main
import (
"log"
"github.com/dannyvankooten/ana/commands"
"github.com/dannyvankooten/ana/db"
"github.com/joho/godotenv"
)
func main() {
log.Println("starting...")
// load .env file
err := godotenv.Load()
if err != nil {
log.Println("no .env file found")
}
// setup database connection
conn, err := db.SetupDatabaseConnection()
if err != nil {
log.Fatal(err)
}
defer conn.Close()
// parse & run cli commands
commands.Parse()
commands.Run()
}