diff --git a/libnetwork/datastore/mockstore_test.go b/libnetwork/datastore/mockstore_test.go index 6532db6a10..db57e8e778 100644 --- a/libnetwork/datastore/mockstore_test.go +++ b/libnetwork/datastore/mockstore_test.go @@ -62,14 +62,16 @@ func (s *MockStore) AtomicPut(key string, newValue []byte, previous *store.KVPai if previous == nil { if mData != nil { return nil, types.InvalidParameterErrorf("atomic put failed because key exists") - } // Else OK. + } + // Else OK. } else { if mData == nil { return nil, types.InvalidParameterErrorf("atomic put failed because key exists") } - if mData != nil && mData.Index != previous.LastIndex { + if mData.Index != previous.LastIndex { return nil, types.InvalidParameterErrorf("atomic put failed due to mismatched Index") - } // Else OK. + } + // Else OK. } if err := s.Put(key, newValue); err != nil { return nil, err