From d8784bc47f7d78bec7c2ce5156b5fa4f92e1ff5e Mon Sep 17 00:00:00 2001 From: cubixle Date: Thu, 21 Jul 2022 21:38:28 +0100 Subject: [PATCH] yaml struct tags, better load docblock --- config/config.go | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/config/config.go b/config/config.go index f923640..654a6c9 100644 --- a/config/config.go +++ b/config/config.go @@ -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 {