mirror of
https://github.com/NVIDIA/nvidia-container-toolkit
synced 2025-06-26 18:18:24 +00:00
Check returned error values
Signed-off-by: Evan Lezar <elezar@nvidia.com>
This commit is contained in:
@@ -119,10 +119,10 @@ func run(c *cli.Context, opts *options) error {
|
||||
}
|
||||
defer output.Close()
|
||||
|
||||
if err != nil {
|
||||
return err
|
||||
if _, err := cfgToml.Save(output); err != nil {
|
||||
return fmt.Errorf("failed to save config: %v", err)
|
||||
}
|
||||
cfgToml.Save(output)
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
|
||||
@@ -85,8 +85,7 @@ func (m command) run(c *cli.Context, opts *flags.Options) error {
|
||||
}
|
||||
defer output.Close()
|
||||
|
||||
_, err = cfgToml.Save(output)
|
||||
if err != nil {
|
||||
if _, err = cfgToml.Save(output); err != nil {
|
||||
return fmt.Errorf("failed to write output: %v", err)
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user