elliotchance / orderedmap

🔃 An ordered map in Go with amortized O(1) for Set, Get, Delete and Len.
MIT License
817 stars 62 forks source link

fix bug of potential panic #21

Closed gua-pian closed 2 years ago

gua-pian commented 2 years ago

according to https://go.dev/ref/spec#Map_types, key type must not be a function, map, or slice


This change is Reviewable

elliotchance commented 2 years ago

This is not a bug with orderedmap, but rather a documented limitation of Go. It is the responsibility of the implementation to prevent illegal values if those situations are possible.