From 2601e660db5ffb7a57e2496c24f9bbb52a0158f3 Mon Sep 17 00:00:00 2001 From: Joe Date: Thu, 1 Feb 2024 20:20:20 +0100 Subject: conf --- src/c_parse.go | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'src/c_parse.go') diff --git a/src/c_parse.go b/src/c_parse.go index 53249cf..a032381 100644 --- a/src/c_parse.go +++ b/src/c_parse.go @@ -52,8 +52,9 @@ package main import ( - "os" "errors" + "fmt" + "os" "gopkg.in/yaml.v3" ) @@ -65,7 +66,7 @@ func c_parse_opts(file string) (HardOpts, error) { if err != nil { return opts, err } - err = yaml.Unmarshal(yaml_file, opts) + err = yaml.Unmarshal(yaml_file, &opts) return opts, err } @@ -77,6 +78,7 @@ func c_read_yaml_file(file string, ui *HardUI) (*HostNode, error) { return nil, err } if err := yaml.Unmarshal(yaml_file, &host); err != nil { + err = errors.New(fmt.Sprintf("%s: %v", file, err)) return nil, err } if len(host.Name) == 0 { -- cgit v1.2.3