mirror of
https://github.com/moby/moby.git
synced 2026-01-11 18:51:37 +00:00
libnetwork/datastore: MockStore.AtomicPut: remove redundant nil check (govet)
libnetwork/datastore/mockstore_test.go:70:12: nilness: tautological condition: non-nil != nil (govet)
if mData != nil && mData.Index != previous.LastIndex {
^
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user