code cleanup: Omit redundant nil check on slices

This commit is contained in:
卢振兴10069964
2021-04-12 09:00:36 +08:00
parent a55bd63172
commit a36c5f08f4
4 changed files with 5 additions and 5 deletions

View File

@@ -380,9 +380,9 @@ func (plugin *FakeVolumePlugin) NewDetacher() (Detacher, error) {
plugin.NewDetacherCallCount = plugin.NewDetacherCallCount + 1
detacher := plugin.getFakeVolume(&plugin.Detachers)
attacherList := plugin.Attachers
if attacherList != nil && len(attacherList) > 0 {
if len(attacherList) > 0 {
detacherList := plugin.Detachers
if detacherList != nil && len(detacherList) > 0 {
if len(detacherList) > 0 {
detacherList[0].VolumesAttached = attacherList[0].VolumesAttached
}