mirror of
https://github.com/kubernetes-sigs/kustomize.git
synced 2026-06-11 17:12:51 +00:00
Handle errors
This commit is contained in:
@@ -213,7 +213,10 @@ func String(node *yaml.Node, opts ...string) (string, error) {
|
||||
b := &bytes.Buffer{}
|
||||
e := NewEncoder(b)
|
||||
err := e.Encode(node)
|
||||
e.Close()
|
||||
errClose := e.Close()
|
||||
if err == nil {
|
||||
err = errClose
|
||||
}
|
||||
val := b.String()
|
||||
if optsSet.Has(Trim) {
|
||||
val = strings.TrimSpace(val)
|
||||
|
||||
Reference in New Issue
Block a user