Go - Pointer to map
Posted
by nevalu
on Stack Overflow
See other posts from Stack Overflow
or by nevalu
Published on 2010-05-11T09:41:25Z
Indexed on
2010/05/11
9:44 UTC
Read the original article
Hit count: 492
Having some maps defined as:
var valueToSomeType = map[uint8]someType{...}
var nameToSomeType = map[string]someType{...}
I would want a variable that points to the address of the maps (to don't copy all variable). I tried it using:
valueTo := &valueToSomeType
nameTo := &nameToSomeType
but at using valueTo[number]
, it shows
internal compiler error: var without type, init: new
How to get it?
© Stack Overflow or respective owner