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

Verilog Error: output or inout port "Q" must be connected to a structural net expression -

jasper reports - How to center align barcode using jasperreports and barcode4j -

c# - ASP.NET MVC - Attaching an entity of type 'MODELNAME' failed because another entity of the same type already has the same primary key value -