1
0
mirror of https://github.com/tw93/Mole.git synced 2026-02-04 18:34:46 +00:00

Go code formatting optimization

This commit is contained in:
Tw93
2026-01-08 15:26:35 +08:00
parent 3e4674f1e6
commit 79a19ffbfe
7 changed files with 25 additions and 28 deletions

View File

@@ -49,7 +49,7 @@ func cloneDirEntries(entries []dirEntry) []dirEntry {
return nil
}
copied := make([]dirEntry, len(entries))
copy(copied, entries)
copy(copied, entries) //nolint:all
return copied
}
@@ -58,7 +58,7 @@ func cloneFileEntries(files []fileEntry) []fileEntry {
return nil
}
copied := make([]fileEntry, len(files))
copy(copied, files)
copy(copied, files) //nolint:all
return copied
}
@@ -208,7 +208,7 @@ func loadCacheFromDisk(path string) (*cacheEntry, error) {
if err != nil {
return nil, err
}
defer file.Close()
defer file.Close() //nolint:errcheck
var entry cacheEntry
decoder := gob.NewDecoder(file)
@@ -258,7 +258,7 @@ func saveCacheToDisk(path string, result scanResult) error {
if err != nil {
return err
}
defer file.Close()
defer file.Close() //nolint:errcheck
encoder := gob.NewEncoder(file)
return encoder.Encode(entry)