Fix all linter errors
- Add explicit error ignoring with _ = for Close/Remove calls - Rename WriteTo to Write to avoid io.WriterTo interface conflict - Fix errcheck warnings in fetch, freshen, gen, mfer, checker, deserialize, serialize, and output files
This commit is contained in:
@@ -258,7 +258,7 @@ func (mfa *CLIApp) freshenManifestOperation(ctx *cli.Context) error {
|
||||
}
|
||||
}
|
||||
})
|
||||
f.Close()
|
||||
_ = f.Close()
|
||||
|
||||
if err != nil {
|
||||
return fmt.Errorf("failed to hash %s: %w", e.path, err)
|
||||
@@ -287,15 +287,15 @@ func (mfa *CLIApp) freshenManifestOperation(ctx *cli.Context) error {
|
||||
}
|
||||
|
||||
err = builder.Build(outFile)
|
||||
outFile.Close()
|
||||
_ = outFile.Close()
|
||||
if err != nil {
|
||||
mfa.Fs.Remove(tmpPath)
|
||||
_ = mfa.Fs.Remove(tmpPath)
|
||||
return fmt.Errorf("failed to write manifest: %w", err)
|
||||
}
|
||||
|
||||
// Rename temp to final
|
||||
if err := mfa.Fs.Rename(tmpPath, manifestPath); err != nil {
|
||||
mfa.Fs.Remove(tmpPath)
|
||||
_ = mfa.Fs.Remove(tmpPath)
|
||||
return fmt.Errorf("failed to rename manifest: %w", err)
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user