hashicorp / go-immutable-radix

An immutable radix tree implementation in Golang
Mozilla Public License 2.0
999 stars 77 forks source link

Is there a way to update a existed value, e.g., append an element to the list #52

Open shenwei356 opened 1 year ago

shenwei356 commented 1 year ago

Something like

// the value is a pointer of a slice
tree.Update(key, function(old T, val TT) {
    if old != nil {
       *old = append(*old, val)
    }
})