[go-nuts] Re: Compare values in a for loop that ranges over string array of array

2018-03-05 Thread Ignacio Gómez
Hi, Ashish. If you have a map[string]int (or int 64, float 64, etc.) "m", doing m[key] += value is equivalent to this: m[key] = m[key] + value. Thus, on each iteration we sum the value at dataarray[j][1] (which you stored at sumFloat) to the current value of sums[dataarray[j][0]] (on first

[go-nuts] Re: Compare values in a for loop that ranges over string array of array

2018-03-05 Thread Ignacio Gómez
You can use a map to keep track of a letters sum. Here's your example slightly modified (it uses float64 as you were using that): https://play.golang.org/p/98L9fDXSN_A El lunes, 5 de marzo de 2018, 15:28:54 (UTC-3), Ashish Timilsina escribió: > > Hi, > > I have an array of array string ([][]stri

Re: [go-nuts] where is an online version of older versions like 1.8 1.6 golang pkg doc ?

2018-01-19 Thread Ignacio Gómez
I think this old discussion about dropping support for ARMv5 (https://github.com/golang/go/issues/17082) makes a point for having docs for older Go versions. It's not always a matter of laziness, sometimes there's no choice. Yeah, the poor lad inheriting a legacy system may and probably will ha

[go-nuts] Mosquitto auth plugin

2018-01-10 Thread Ignacio Gómez
Hi, guys. I've recently written an authentication/authorization plugin for mosquitto, a well known open-source MQTT broker, using cgo. The basic idea was to export some Go functions to mosquitto's C plugin interface, and write all the logic in Go. It implements a bunch of backends available, an