mirror of
https://github.com/cubixle/tuukoti-framework.git
synced 2026-04-30 02:48:41 +01:00
yaml struct tags, better load docblock
This commit is contained in:
+3
-5
@@ -8,13 +8,11 @@ import (
|
|||||||
)
|
)
|
||||||
|
|
||||||
type Config struct {
|
type Config struct {
|
||||||
Host string
|
Host string `yaml:"host"`
|
||||||
Debug bool
|
Debug bool `yaml:"debug"`
|
||||||
}
|
}
|
||||||
|
|
||||||
// Load is opinionated by the default location of the config file.
|
// Load simply loads the config from location "path".
|
||||||
// This location is the root of the project.
|
|
||||||
// Ff you want to change the location then you can use the env var TUUKOTI_CONFIG.
|
|
||||||
func Load(path string) (*Config, error) {
|
func Load(path string) (*Config, error) {
|
||||||
f, err := os.ReadFile(path)
|
f, err := os.ReadFile(path)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
|||||||
Reference in New Issue
Block a user