yaml struct tags, better load docblock

This commit is contained in:
cubixle
2022-07-21 21:38:28 +01:00
parent 3c56200afa
commit d8784bc47f

View File

@@ -8,13 +8,11 @@ import (
)
type Config struct {
Host string
Debug bool
Host string `yaml:"host"`
Debug bool `yaml:"debug"`
}
// Load is opinionated by the default location of the config file.
// This location is the root of the project.
// Ff you want to change the location then you can use the env var TUUKOTI_CONFIG.
// Load simply loads the config from location "path".
func Load(path string) (*Config, error) {
f, err := os.ReadFile(path)
if err != nil {