go-datastructures icon indicating copy to clipboard operation
go-datastructures copied to clipboard

Dtrie.Get() panics on unexisting key

Open asido opened this issue 6 years ago • 1 comments

// Get returns the value for the associated key or returns nil if the
// key does not exist.
func (d *Dtrie) Get(key interface{}) interface{} {
	return get(d.root, d.hasher(key), key).Value()
}

get() returns nil if the key is not found and thus Value() raises a panic. Is that by design?

asido avatar Apr 04 '19 09:04 asido

https://github.com/Workiva/go-datastructures/pull/207

AliceBennett avatar Oct 31 '19 03:10 AliceBennett