-
Notifications
You must be signed in to change notification settings - Fork 113
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
panic: unsupported key type *foo #53
Comments
Of note, i could use the "Attribute.ID" in my example as the key of the hashmap, then use the *Value as the value, but since in my code I am already looking up the attribute by Name, i have no desire to dereference it in order to get it's ID before interogating the map for values of a certain Attribute/Value combination. Also of note, I'm pretty new to Go, and don't really know what i'm doing, lol. |
@jeremy-giaco the issue is triggered when trying to compute the hash for the key. This lib supports the following keys Line 44 in c93d96c
sync.Map uses the internal map hash function which dereferences the pointer and uses memory value to compute the hash which this lib does not support |
still not supported? |
Apparently it is not currently possible to add a reference to a struct as a key in the hashmap. This is valid in the native map, sync.Map, etc.
In this example, i create an "Attribute" and "Value" struct, then try to create a map of key: *Attribute, value:*Value...
https://play.golang.org/p/m2RkogzD-82
Error returned is: panic: unsupported key type *main.Attribute
The text was updated successfully, but these errors were encountered: