fix: extend error handling
All checks were successful
Golang Tests / unittest (stable, ubuntu-latest-amd64) (push) Successful in 8s
Lint Markdown files / markdown-lint (push) Successful in 4s
Golang CI lint / golangci (stable, ubuntu-latest-amd64) (push) Successful in 2m31s
Golang Tests / unittest (stable, ubuntu-latest-arm64) (push) Successful in 45s
Golang CI lint / golangci (stable, ubuntu-latest-arm64) (push) Successful in 1m50s

This commit is contained in:
2025-06-01 13:47:15 +02:00
parent 17695e0996
commit f0955bc835
3 changed files with 9 additions and 9 deletions

View File

@ -65,7 +65,7 @@ func (jr *JSONReader) ReadFile() (*domain.Config, error) {
if err != nil {
return nil, err
}
defer f.Close()
defer func() { _ = f.Close() }()
return jr.read(f)
}
@ -79,7 +79,7 @@ func (jw *JSONWriter) WriteFile(config *domain.Config) error {
if err != nil {
return err
}
defer func() { f.Close() }()
defer func() { _ = f.Close() }()
return jw.write(f, config)
}
@ -103,7 +103,7 @@ func (yr *YAMLReader) ReadFile() (*domain.Config, error) {
if err != nil {
return nil, err
}
defer f.Close()
defer func() { _ = f.Close() }()
return yr.read(f)
}
@ -129,7 +129,7 @@ func (yw *YAMLWriter) WriteFile(config *domain.Config) error {
if err != nil {
return err
}
defer func() { f.Close() }()
defer func() { _ = f.Close() }()
return yw.write(f, config)
}