You may be missing a "continue" in your "if cont == 0" block.
Seth
On Nov 28, 2016 7:33 AM, "Sergio Hunter" wrote:
> Hi everybody. I need help. When outputting data to a csv file, the dates
> is duplicated, but should merge and be counted. How to write correctly?
> Thanks.
>
>
>
> package main
Just a Go map -- like you're already using elsewhere in the code. It's the
same as a hash in Perl or a dict in Python -- you can't have duplicate keys.
So if you create a map that has the date as the key and anything as the
value (an empty struct is idiomatic, but you can also use a boolean), then
I can't understand about "map", Could you explain me please?
понедельник, 28 ноября 2016 г., 18:35:54 UTC+2 пользователь Shawn Milochik
написал:
>
> The dates are just being appended without being checked for duplication:
>
> for userStats := range userStatsData.Dates {
> date
The dates are just being appended without being checked for duplication:
for userStats := range userStatsData.Dates {
dates = append(dates, userStats)
}
You could use a map for this.
Also, check your errors: data, _ = ioutil.ReadAll(r)
If the first "if" block for th
Hi everybody. I need help. When outputting data to a csv file, the dates is
duplicated, but should merge and be counted. How to write correctly? Thanks.
package main
import (
"database/sql"
"log"
_"github.com/go-sql-driver/mysql"
"compress/zlib"
"bytes"