Answer the question
In order to leave comments, you need to log in
How to check if a date is unique in Go?
In the cycle of adding dates to the array, you need to check for uniqueness, and if identical elements are found, then you need to sum them up, in other words, the data is unloaded from the database into a csv file in which the dates are duplicated, it must be merged into one. An example if possible, thanks.
Answer the question
In order to leave comments, you need to log in
Use map for example. You check the presence of the date in the map, if not, then add a value there, if there is, then add the new one to the existing one.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question