But it would be the most bloodless way. Go is positioned to develop various
APIs and microservices. This is often associated with high loads (in my
practice - always). I tired of wrapping the map into structures.
Nevertheless, I would like to hear, in occasion of generics, how this would
simplify the work with the map.

вт, 11 лип. 2017 о 00:27 <am...@ammar.io> пише:

> I'm not sure it sets a good precedent adding more data structures to the
> language. we need generics
>
> On Sunday, July 9, 2017 at 10:23:42 PM UTC-5, Олексій Чечель wrote:
>>
>> I do not understand what prevents the authors of the language from
>> determining the thread-safe type *cmap*(name is taken for example) with
>> builtin mutex:
>>
>> *X: = cmap[int]string{}*
>> *Y: = make(cmap[string]interface{})*
>>
>>
>> *x, exists := X[10]**y, ok := Y["some"]*
>>
>>
>> In this case, the programmer might get a choice, use a fast but unsafe
>> map or slower (but with internal mutex) *cmap*. It would be with a
>> standard API, instead of stupid *sync/#Map
>> <https://tip.golang.org/pkg/sync/#Map>*
>>
>> They wrote: "grab a mutex would slow down most programs and add safety to
>> few". Ok, give me choise to use map or *cmap* with similar API.
>>
>> пʼятниця, 16 червня 2017 р. 12:26:04 UTC+7 користувач am...@ammar.io
>> написав:
>>>
>>> https://github.com/ammario/mapgen
>>>
>>>
>>> Features:
>>>
>>>    - Supports any key/value pair supported by Go's native maps
>>>    - Allows complex operations via Lock() and Unlock()
>>>    - Generated code conforms to golint and gofmt
>>>    - Allows custom types
>>>    - Sensible default file name and map name
>>>
>>> --
> You received this message because you are subscribed to a topic in the
> Google Groups "golang-nuts" group.
> To unsubscribe from this topic, visit
> https://groups.google.com/d/topic/golang-nuts/_7XcsQxGPi0/unsubscribe.
> To unsubscribe from this group and all its topics, send an email to
> golang-nuts+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google Groups 
"golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to golang-nuts+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to