On Mon, 2022-05-30 at 08:23 -0700, Vejju Deepesh wrote: > I want know the method of preventing sorting by default and maintain > the map in the order of insertion
If you want ordered return of elements and O(1) look-up, use a slice and an index map. Insertion becomes and appends and a map insertion with the length of the slice after append (if the element is not already in the map - no-op otherwise), look-up is an index map query and then slice access, and container dump is an iteration over the slice. -- 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/0e521de4259d1f69a6d5126d7f01366211fa5a79.camel%40kortschak.io.