31 lines
411 B
Go
31 lines
411 B
Go
package main
|
|
|
|
import (
|
|
"log/slog"
|
|
"os"
|
|
|
|
"github.com/BurntSushi/toml"
|
|
)
|
|
|
|
type Config struct {
|
|
Server bool
|
|
}
|
|
|
|
var conf Config
|
|
|
|
func main() {
|
|
slog.Info("Starting...")
|
|
|
|
confPath := "config.toml"
|
|
_, err := os.Stat(confPath)
|
|
if err != nil {
|
|
confPath = "/etc/morffix/config.toml"
|
|
}
|
|
|
|
_, err = toml.DecodeFile(confPath, &conf)
|
|
if err != nil {
|
|
slog.Error("Error Loading Config", "err", err)
|
|
return
|
|
}
|
|
|
|
}
|