Skip to content

Commit

Permalink
[hcledit/read] rename error for readability
Browse files Browse the repository at this point in the history
  • Loading branch information
ryan-ph committed Apr 24, 2024
1 parent 5c85ac9 commit 7e17f36
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions hcledit.go
Original file line number Diff line number Diff line change
Expand Up @@ -100,17 +100,17 @@ func (h *HCLEditor) Read(queryStr string, opts ...Option) (map[string]interface{
Mode: walker.Read,
}

err = w.Walk(h.writeFile.Body(), queries, 0, []string{})
if err != nil && !fallback {
return nil, err
walkErr := w.Walk(h.writeFile.Body(), queries, 0, []string{})
if walkErr != nil && !fallback {
return nil, walkErr
}

ret, convertErr := convert(results)
if convertErr != nil {
return ret, convertErr
}

return ret, err
return ret, walkErr
}

// Update replaces attributes and blocks which matched with its key
Expand Down

0 comments on commit 7e17f36

Please sign in to comment.