go map key by reference, comparison by dereference -


i need use large maps large strings keys. there way in go's default map specify comparison test key treated address? if not, there libraries implement this?

note want prevent long strings being passed copy whenever map lookup made.

for particular case of strings, go want default: strings represented pointer/length pairs you're not copying string data around when copy strings.

in general, can't specify custom comparison (or hash) function. other types , custom structs are treated according rules listed in spec: pointers compared address, example, fixed-size arrays compared value, , slice types aren't comparable in general struct types include them aren't usable map key types.


Comments

Popular posts from this blog

javascript - how to protect a flash video from refresh? -

visual studio 2010 - Connect to informix database windows form application -

android - Associate same looper with different threads -