Skip to content

Commit

Permalink
fix: handle error in YAML marshaling
Browse files Browse the repository at this point in the history
  • Loading branch information
hbagdi authored and rainest committed Apr 21, 2021
1 parent 9b1fcb5 commit a059b44
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions file/writer.go
Original file line number Diff line number Diff line change
Expand Up @@ -166,6 +166,10 @@ func KongStateToFile(kongState *state.KongState, filename string) error {
})

c, err := yaml.Marshal(file)
if err != nil {
return err
}

if filename == "-" {
_, err = fmt.Print(string(c))
} else {
Expand Down

0 comments on commit a059b44

Please sign in to comment.