lint: fix errcheck for Close and Write calls across multiple files
Use lint.LogOnErr for deferred Body/File/Client Close calls. Use lint.Write for unchecked w.Write calls. Fix bug in sync/sms.go where fmt.Errorf result was discarded (replace with proper log.Error call).
This commit is contained in:
parent
c7a7e8431c
commit
0ec810591e
9 changed files with 24 additions and 15 deletions
|
|
@ -19,6 +19,7 @@ import (
|
|||
"github.com/Gleipnir-Technology/bob/dialect/psql"
|
||||
"github.com/Gleipnir-Technology/bob/dialect/psql/sm"
|
||||
"github.com/Gleipnir-Technology/nidus-sync/config"
|
||||
"github.com/Gleipnir-Technology/nidus-sync/lint"
|
||||
"github.com/Gleipnir-Technology/nidus-sync/db"
|
||||
"github.com/Gleipnir-Technology/nidus-sync/db/models"
|
||||
"github.com/Gleipnir-Technology/nidus-sync/platform/oauth"
|
||||
|
|
@ -242,7 +243,7 @@ func loadTileFromDisk(tile_path string) (*TileRaster, error) {
|
|||
if err != nil {
|
||||
return nil, fmt.Errorf("open: %w", err)
|
||||
}
|
||||
defer file.Close()
|
||||
defer lint.LogOnErr(file.Close, "close tile file")
|
||||
img, err := io.ReadAll(file)
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("readall from %s: %w", tile_path, err)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue