Skip to content

Commit 2ad3f57

Browse files
committed
fix redundant error checks and comment format
Signed-off-by: bo.jiang <[email protected]>
1 parent 1427761 commit 2ad3f57

File tree

3 files changed

+4
-15
lines changed

3 files changed

+4
-15
lines changed

pkg/containerutil/container_network_manager.go

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -420,11 +420,7 @@ func (m *hostNetworkManager) SetupNetworking(ctx context.Context, containerID st
420420
}
421421

422422
// Save the meta information
423-
if err = hs.Acquire(hsMeta); err != nil {
424-
return err
425-
}
426-
427-
return nil
423+
return hs.Acquire(hsMeta)
428424
}
429425

430426
// CleanupNetworking Performs any required cleanup actions for the given container.
@@ -449,11 +445,7 @@ func (m *hostNetworkManager) CleanupNetworking(ctx context.Context, container co
449445
}
450446

451447
// Release
452-
if err = hs.Release(container.ID()); err != nil {
453-
return err
454-
}
455-
456-
return nil
448+
return hs.Release(container.ID())
457449
}
458450

459451
// InternalNetworkingOptionLabels Returns the set of NetworkingOptions which should be set as labels on the container.

pkg/lockutil/lockutil_unix.go

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -72,8 +72,5 @@ func Unlock(locked *os.File) error {
7272
_ = locked.Close()
7373
}()
7474

75-
if err := flock(locked, unix.LOCK_UN); err != nil {
76-
return err
77-
}
78-
return nil
75+
return flock(locked, unix.LOCK_UN)
7976
}

pkg/mountutil/volumestore/volumestore.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ const (
3939
volumeJSONFileName = "volume.json"
4040
)
4141

42-
// ErrNameStore will wrap all errors here
42+
// ErrVolumeStore will wrap all errors here
4343
var ErrVolumeStore = errors.New("volume-store error")
4444

4545
type VolumeStore interface {

0 commit comments

Comments
 (0)