add support for toml configuration file
This commit is contained in:
parent
2e90d32ce2
commit
fb43d8da3a
2 changed files with 22 additions and 10 deletions
12
main.go
12
main.go
|
|
@ -2,9 +2,21 @@ package main
|
|||
|
||||
import (
|
||||
"net/http"
|
||||
"github.com/BurntSushi/toml"
|
||||
)
|
||||
|
||||
type tomlConfig struct {
|
||||
Database databaseConfig
|
||||
}
|
||||
|
||||
var config tomlConfig
|
||||
|
||||
func main() {
|
||||
_, err := toml.DecodeFile("config.toml", &config)
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
|
||||
db, err := prepareDatabase()
|
||||
if err != nil {
|
||||
panic(err)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue