func Read(path string) (*Config, error) {
	if strings.TrimSpace(path) == "" {
		path = "config.toml"
	}
	config := Config{}
	err := configor.New(&configor.Config{ENVPrefix: "GHZ"}).Load(&config, path)
	if err != nil {
		return nil, err
	}
	return &config, nil
}
Read the config file
package config
import (
	"strings"
	"github.com/jinzhu/configor"
)
type Config struct {
	Server   Server
	Database Database
	Log      Log
}
type Log struct {
	Level string `default:"info"`
	Path  string
}
type Database struct {
	Type       string `default:"sqlite3"`
	Connection string `default:"data/ghz.db"`
}
type Server struct {
	Port uint `default:"80"`
}