linter: enable errchkjson

Signed-off-by: Valentin Rothberg <vrothberg@redhat.com>
This commit is contained in:
Valentin Rothberg
2022-03-21 13:47:59 +01:00
parent bb6b69b4ab
commit f72a678f2a
3 changed files with 7 additions and 4 deletions

View File

@ -479,7 +479,10 @@ func IsCommandAvailable(command string) bool {
func WriteJSONFile(data []byte, filePath string) error {
var jsonData map[string]interface{}
json.Unmarshal(data, &jsonData)
formatJSON, _ := json.MarshalIndent(jsonData, "", " ")
formatJSON, err := json.MarshalIndent(jsonData, "", " ")
if err != nil {
return err
}
return ioutil.WriteFile(filePath, formatJSON, 0644)
}