mirror of
https://github.com/containers/podman.git
synced 2025-07-02 00:30:00 +08:00
enable errcheck linter
The errcheck linter makes sure that errors are always check and not ignored by accident. It spotted a lot of unchecked errors, mostly in the tests but also some real problem in the code. Signed-off-by: Paul Holzinger <pholzing@redhat.com>
This commit is contained in:
@ -489,7 +489,9 @@ func IsCommandAvailable(command string) bool {
|
||||
// WriteJSONFile write json format data to a json file
|
||||
func WriteJSONFile(data []byte, filePath string) error {
|
||||
var jsonData map[string]interface{}
|
||||
json.Unmarshal(data, &jsonData)
|
||||
if err := json.Unmarshal(data, &jsonData); err != nil {
|
||||
return err
|
||||
}
|
||||
formatJSON, err := json.MarshalIndent(jsonData, "", " ")
|
||||
if err != nil {
|
||||
return err
|
||||
|
Reference in New Issue
Block a user