Skip to content

Commit

Permalink
remove var err error declarations from ReadInBuffer and WriteFile
Browse files Browse the repository at this point in the history
  • Loading branch information
Dabnsky committed Jun 11, 2024
1 parent 3af706f commit 704b134
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions component/file_cache/file_cache.go
Original file line number Diff line number Diff line change
Expand Up @@ -958,8 +958,7 @@ func (fc *FileCache) ReadInBuffer(options internal.ReadInBufferOptions) (int, er
// The file should already be in the cache since CreateFile/OpenFile was called before and a shared lock was acquired.
// log.Debug("FileCache::ReadInBuffer : Reading %v bytes from %s", len(options.Data), options.Handle.Path)

var err error
err = fc.downloadFile(options.Handle)
err := fc.downloadFile(options.Handle)
if err != nil {
return 0, fmt.Errorf("error downloading file for %s [%s]", options.Handle.Path, err)
}
Expand Down Expand Up @@ -994,8 +993,7 @@ func (fc *FileCache) WriteFile(options internal.WriteFileOptions) (int, error) {
// The file should already be in the cache since CreateFile/OpenFile was called before and a shared lock was acquired.
//log.Debug("FileCache::WriteFile : Writing %v bytes from %s", len(options.Data), options.Handle.Path)

var err error
err = fc.downloadFile(options.Handle)
err := fc.downloadFile(options.Handle)
if err != nil {
return 0, fmt.Errorf("error downloading file for %s [%s]", options.Handle.Path, err)
}
Expand Down

0 comments on commit 704b134

Please sign in to comment.