MCPcopy
hub / github.com/dropbox/godropbox / Add

Method Add

lockstore/map.go:51–51  ·  view source on GitHub ↗

Add the value to the map if and only if one of: it doesn't exist or (it exists, a ValueCheckFunc is defined, the check func returns false). Returns a bool where true indicates this value was added to the map, false means it was already in the map (and the ValueCheckFunc if defined returned true).

(string, interface{})

Source from the content-addressed store, hash-verified

49 // where true indicates this value was added to the map, false means it was
50 // already in the map (and the ValueCheckFunc if defined returned true).
51 Add(string, interface{}) bool
52
53 // AddOrGet for atomically and serially adding a value to the map if it
54 // does not exist. If the key is already in the map, the existing value is

Callers 9

TestGetSetAddMethod · 0.95
TestGetWithCheckFuncMethod · 0.95
TestAddOrGetHoldsLockMethod · 0.95
TestLockKeySimple2Method · 0.65
testLockKeyParallelMethod · 0.65
TestLockKeyMultipleMethod · 0.65

Implementers 2

lockingMapcontainer/concurrent/lockstore/map.go
lockingMaplockstore/map.go

Calls

no outgoing calls

Tested by 9

TestGetSetAddMethod · 0.76
TestGetWithCheckFuncMethod · 0.76
TestAddOrGetHoldsLockMethod · 0.76
TestLockKeySimple2Method · 0.52
testLockKeyParallelMethod · 0.52
TestLockKeyMultipleMethod · 0.52