go1.24: fix lint, unit and system tests

- development env: base on debian trixie with go1.24
- lint: run with default config
- fix lint errors
- fix unit tests
- fix system test
This commit is contained in:
André Roth
2025-04-12 17:53:48 +02:00
parent ae5379d84a
commit f7057a9517
117 changed files with 803 additions and 727 deletions

View File

@@ -86,13 +86,17 @@ func (storage *PublishedStorage) PutFile(path string, sourceFilename string) err
if err != nil {
return err
}
defer source.Close()
defer func() {
_ = source.Close()
}()
f, err = os.Create(filepath.Join(storage.rootPath, path))
if err != nil {
return err
}
defer f.Close()
defer func() {
_ = f.Close()
}()
_, err = io.Copy(f, source)
return err
@@ -221,20 +225,20 @@ func (storage *PublishedStorage) LinkFromPool(publishedPrefix, publishedRelPath,
var dst *os.File
dst, err = os.Create(filepath.Join(poolPath, baseName))
if err != nil {
r.Close()
_ = r.Close()
return err
}
_, err = io.Copy(dst, r)
if err != nil {
r.Close()
dst.Close()
_ = r.Close()
_ = dst.Close()
return err
}
err = r.Close()
if err != nil {
dst.Close()
_ = dst.Close()
return err
}