@@ -104,8 +104,8 @@ func (fs *FileSystem) GetIOConnection() (*connection.IRODSConnection, error) {
104
104
}
105
105
106
106
// ReturnIOConnection returns irods connection for IO back to session
107
- func (fs * FileSystem ) ReturnIOConnection (conn * connection.IRODSConnection ) {
108
- fs .ioSession .ReturnConnection (conn )
107
+ func (fs * FileSystem ) ReturnIOConnection (conn * connection.IRODSConnection ) error {
108
+ return fs .ioSession .ReturnConnection (conn )
109
109
}
110
110
111
111
// GetMetadataConnection returns irods connection for metadata operations
@@ -114,8 +114,8 @@ func (fs *FileSystem) GetMetadataConnection() (*connection.IRODSConnection, erro
114
114
}
115
115
116
116
// ReturnMetadataConnection returns irods connection for metadata operations back to session
117
- func (fs * FileSystem ) ReturnMetadataConnection (conn * connection.IRODSConnection ) {
118
- fs .metadataSession .ReturnConnection (conn )
117
+ func (fs * FileSystem ) ReturnMetadataConnection (conn * connection.IRODSConnection ) error {
118
+ return fs .metadataSession .ReturnConnection (conn )
119
119
}
120
120
121
121
// ConnectionTotal counts current established connections
@@ -129,7 +129,7 @@ func (fs *FileSystem) GetServerVersion() (*types.IRODSVersion, error) {
129
129
if err != nil {
130
130
return nil , err
131
131
}
132
- defer fs .metadataSession .ReturnConnection (conn )
132
+ defer fs .metadataSession .ReturnConnection (conn ) //nolint
133
133
134
134
return conn .GetVersion (), nil
135
135
}
@@ -274,7 +274,7 @@ func (fs *FileSystem) RemoveDir(path string, recurse bool, force bool) error {
274
274
if err != nil {
275
275
return err
276
276
}
277
- defer fs .metadataSession .ReturnConnection (conn )
277
+ defer fs .metadataSession .ReturnConnection (conn ) //nolint
278
278
279
279
err = irods_fs .DeleteCollection (conn , irodsPath , recurse , force )
280
280
if err != nil {
@@ -294,7 +294,7 @@ func (fs *FileSystem) RemoveFile(path string, force bool) error {
294
294
if err != nil {
295
295
return err
296
296
}
297
- defer fs .metadataSession .ReturnConnection (conn )
297
+ defer fs .metadataSession .ReturnConnection (conn ) //nolint
298
298
299
299
// if file handle is opened, wg
300
300
wg := sync.WaitGroup {}
@@ -348,7 +348,7 @@ func (fs *FileSystem) RenameDirToDir(srcPath string, destPath string) error {
348
348
if err != nil {
349
349
return err
350
350
}
351
- defer fs .metadataSession .ReturnConnection (conn )
351
+ defer fs .metadataSession .ReturnConnection (conn ) //nolint
352
352
353
353
// preprocess
354
354
handles , err := fs .preprocessRenameFileHandleForDir (irodsSrcPath )
@@ -398,7 +398,7 @@ func (fs *FileSystem) RenameFileToFile(srcPath string, destPath string) error {
398
398
if err != nil {
399
399
return err
400
400
}
401
- defer fs .metadataSession .ReturnConnection (conn )
401
+ defer fs .metadataSession .ReturnConnection (conn ) //nolint
402
402
403
403
// preprocess
404
404
handles , err := fs .preprocessRenameFileHandle (irodsSrcPath )
@@ -550,7 +550,7 @@ func (fs *FileSystem) MakeDir(path string, recurse bool) error {
550
550
if err != nil {
551
551
return err
552
552
}
553
- defer fs .metadataSession .ReturnConnection (conn )
553
+ defer fs .metadataSession .ReturnConnection (conn ) //nolint
554
554
555
555
dirEntry , err := fs .StatDir (path )
556
556
if err == nil {
@@ -598,7 +598,7 @@ func (fs *FileSystem) CopyFileToFile(srcPath string, destPath string, force bool
598
598
if err != nil {
599
599
return err
600
600
}
601
- defer fs .metadataSession .ReturnConnection (conn )
601
+ defer fs .metadataSession .ReturnConnection (conn ) //nolint
602
602
603
603
err = irods_fs .CopyDataObject (conn , irodsSrcPath , irodsDestPath , force )
604
604
if err != nil {
@@ -622,7 +622,7 @@ func (fs *FileSystem) TruncateFile(path string, size int64) error {
622
622
if err != nil {
623
623
return err
624
624
}
625
- defer fs .metadataSession .ReturnConnection (conn )
625
+ defer fs .metadataSession .ReturnConnection (conn ) //nolint
626
626
627
627
err = irods_fs .TruncateDataObject (conn , irodsPath , size )
628
628
if err != nil {
@@ -642,7 +642,7 @@ func (fs *FileSystem) ReplicateFile(path string, resource string, update bool) e
642
642
if err != nil {
643
643
return err
644
644
}
645
- defer fs .metadataSession .ReturnConnection (conn )
645
+ defer fs .metadataSession .ReturnConnection (conn ) //nolint
646
646
647
647
err = irods_fs .ReplicateDataObject (conn , irodsPath , resource , update , false )
648
648
if err != nil {
@@ -666,7 +666,7 @@ func (fs *FileSystem) OpenFile(path string, resource string, mode string) (*File
666
666
keywords := map [common.KeyWord ]string {}
667
667
handle , offset , err := irods_fs .OpenDataObject (conn , irodsPath , resource , mode , keywords )
668
668
if err != nil {
669
- fs .ioSession .ReturnConnection (conn )
669
+ fs .ioSession .ReturnConnection (conn ) //nolint
670
670
return nil , err
671
671
}
672
672
@@ -724,27 +724,27 @@ func (fs *FileSystem) CreateFile(path string, resource string, mode string) (*Fi
724
724
keywords := map [common.KeyWord ]string {}
725
725
handle , err := irods_fs .CreateDataObject (conn , irodsPath , resource , mode , true , keywords )
726
726
if err != nil {
727
- fs .ioSession .ReturnConnection (conn )
727
+ fs .ioSession .ReturnConnection (conn ) //nolint
728
728
return nil , err
729
729
}
730
730
731
731
// close - this is required to let other processes see the file existence
732
732
err = irods_fs .CloseDataObject (conn , handle )
733
733
if err != nil {
734
- fs .ioSession .ReturnConnection (conn )
734
+ fs .ioSession .ReturnConnection (conn ) //nolint
735
735
return nil , err
736
736
}
737
737
738
738
entry , err := fs .getDataObjectWithConnectionNoCache (conn , irodsPath )
739
739
if err != nil {
740
- fs .ioSession .ReturnConnection (conn )
740
+ fs .ioSession .ReturnConnection (conn ) //nolint
741
741
return nil , err
742
742
}
743
743
744
744
// re-open
745
745
handle , offset , err := irods_fs .OpenDataObject (conn , irodsPath , resource , mode , keywords )
746
746
if err != nil {
747
- fs .ioSession .ReturnConnection (conn )
747
+ fs .ioSession .ReturnConnection (conn ) //nolint
748
748
return nil , err
749
749
}
750
750
@@ -773,7 +773,7 @@ func (fs *FileSystem) getCollectionNoCache(path string) (*Entry, error) {
773
773
if err != nil {
774
774
return nil , err
775
775
}
776
- defer fs .metadataSession .ReturnConnection (conn )
776
+ defer fs .metadataSession .ReturnConnection (conn ) //nolint
777
777
778
778
collection , err := irods_fs .GetCollection (conn , path )
779
779
if err != nil {
@@ -894,7 +894,7 @@ func (fs *FileSystem) listEntries(collection *types.IRODSCollection) ([]*Entry,
894
894
if err != nil {
895
895
return nil , err
896
896
}
897
- defer fs .metadataSession .ReturnConnection (conn )
897
+ defer fs .metadataSession .ReturnConnection (conn ) //nolint
898
898
899
899
collections , err := irods_fs .ListSubCollections (conn , collection .Path )
900
900
if err != nil {
@@ -990,7 +990,7 @@ func (fs *FileSystem) getDataObjectNoCache(path string) (*Entry, error) {
990
990
if err != nil {
991
991
return nil , err
992
992
}
993
- defer fs .metadataSession .ReturnConnection (conn )
993
+ defer fs .metadataSession .ReturnConnection (conn ) //nolint
994
994
995
995
dataobject , err := irods_fs .GetDataObjectMasterReplicaWithoutCollection (conn , path )
996
996
if err != nil {
0 commit comments