Skip to content

Commit

Permalink
Merge pull request #3693 from ErikJiang/fix_lint_issue
Browse files Browse the repository at this point in the history
fix redundant error checks and comment format
  • Loading branch information
Zheaoli authored Nov 26, 2024
2 parents 1427761 + 2ad3f57 commit 43b6133
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 15 deletions.
12 changes: 2 additions & 10 deletions pkg/containerutil/container_network_manager.go
Original file line number Diff line number Diff line change
Expand Up @@ -420,11 +420,7 @@ func (m *hostNetworkManager) SetupNetworking(ctx context.Context, containerID st
}

// Save the meta information
if err = hs.Acquire(hsMeta); err != nil {
return err
}

return nil
return hs.Acquire(hsMeta)
}

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

// Release
if err = hs.Release(container.ID()); err != nil {
return err
}

return nil
return hs.Release(container.ID())
}

// InternalNetworkingOptionLabels Returns the set of NetworkingOptions which should be set as labels on the container.
Expand Down
5 changes: 1 addition & 4 deletions pkg/lockutil/lockutil_unix.go
Original file line number Diff line number Diff line change
Expand Up @@ -72,8 +72,5 @@ func Unlock(locked *os.File) error {
_ = locked.Close()
}()

if err := flock(locked, unix.LOCK_UN); err != nil {
return err
}
return nil
return flock(locked, unix.LOCK_UN)
}
2 changes: 1 addition & 1 deletion pkg/mountutil/volumestore/volumestore.go
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ const (
volumeJSONFileName = "volume.json"
)

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

type VolumeStore interface {
Expand Down

0 comments on commit 43b6133

Please sign in to comment.