diff --git a/yamlutils/go.mod b/yamlutils/go.mod index 5fd8693..16ce076 100644 --- a/yamlutils/go.mod +++ b/yamlutils/go.mod @@ -1,4 +1,4 @@ -module github.com/dgtools/yamlutils +module github.com/DavidGamba/dgtools/yamlutils go 1.16 diff --git a/yamlutils/yamlutils.go b/yamlutils/yamlutils.go index 20d168c..3461119 100644 --- a/yamlutils/yamlutils.go +++ b/yamlutils/yamlutils.go @@ -46,6 +46,10 @@ type YML struct { func NewFromFile(filename string) ([]*YML, error) { list := []*YML{} fh, err := os.Open(filename) + if err != nil { + return nil, err + } + decoder := yaml.NewDecoder(fh) for { var tree interface{}