go - Proper way of using derived map type index in golang -


This could be the starting question. Code like

  type MYMAP map [int] int func (o * MYMAP) dosth () {// it will fail to compile o [1] = 2}  

How to use the underlying type MYMAP in the form of a map ?

The problem is not that it is a nickname, it is an indicator for a map .

Go will not automatically be used by the Dictation Pointer for the map or the slice method, by changing the way with the o [1] = 2 to (* O) [1] = 2 will work however you should consider why you are using an indicator on the map (effectively). There are good reasons for doing this, but generally you do not need an indicator on the map because maps are "reference types", which means that you do not need an indicator on them so that they are mutually mutating Can change Program

Comments

Popular posts from this blog

Pass DB Connection parameters to a Kettle a.k.a PDI table Input step dynamically from Excel -

multithreading - PhantomJS-Node in a for Loop -

c++ - MATLAB .m file to .mex file using Matlab Compiler -