We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 77bec26 commit c5a6726Copy full SHA for c5a6726
root.go
@@ -1,7 +1,9 @@
1
package seer
2
3
import (
4
+ "errors"
5
"fmt"
6
+ "io"
7
"os"
8
"strings"
9
@@ -76,11 +78,12 @@ func (s *Seer) loadYamlDocument(path string) (*yaml.Node, error) {
76
78
if err != nil {
77
79
return nil, fmt.Errorf("Opening yaml file %s failed with %s", path, err.Error())
80
}
81
+ defer f.Close()
82
83
root_node := &yaml.Node{}
84
yaml_decoder := yaml.NewDecoder(f)
85
err = yaml_decoder.Decode(root_node)
- if err != nil {
86
+ if err != nil && !errors.Is(err, io.EOF) {
87
return nil, fmt.Errorf("Processing yaml file %s failed with %s", path, err.Error())
88
89
0 commit comments