Your need is not only to sort your data elements then..?
Using the previously advised solution you can just range the slice *after*
you sort it, so you can just check for the next element, which I'd say is
not *too bad*, what are your performance constraints?

Le sam. 13 mars 2021 à 21:33, Vasiliy Tolstov <v.tols...@selfip.ru> a
écrit :

> Looks fine =) But how to remove duplicates?
> I'm found this stuff
> https://github.com/campoy/unique/blob/master/unique.go but as i
> understand it needs to adapt to my case =)
>
> сб, 13 мар. 2021 г. в 16:47, 'Carla Pfaff' via golang-nuts
> <golang-nuts@googlegroups.com>:
> >
> > On Saturday, 13 March 2021 at 14:44:05 UTC+1 mlevi...@gmail.com wrote:
> >>
> >> the sort package from the stdlib, it contains an interface that you can
> easily implement for such problematics :)
> >
> >
> > Like this: https://play.golang.org/p/eoLJ2aVAWkD
> >
> >
> > --
> > 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.
> > To view this discussion on the web visit
> https://groups.google.com/d/msgid/golang-nuts/b8caea5d-fc98-41cf-85aa-b1526105840bn%40googlegroups.com
> .
>
>
>
> --
> Vasiliy Tolstov,
> e-mail: v.tols...@selfip.ru
>
> --
> 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.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/golang-nuts/CACaajQt22G7JxY3yGiMt_H37aSkBatz3W6FZF90Gv90Uo0zTUA%40mail.gmail.com
> .
>

-- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/golang-nuts/CAL4P9zwK5vh1cwmq0yrCVuJsNCg0WXqfhZuXg%2BgV2MTFO--KvQ%40mail.gmail.com.

Reply via email to