I have 16 go routines which return output , which is typically a struct.
struct output{
index int,
description string,
}
Now all these 16 go routines run in parallel, and the total expected output structs from all the go routines is expected to be a million. I have used the basic sorting of go lang it is very expensive to do that, could some one help me with the approach to take to sort the output based on the index and I need to write the "description" field on to a file based on the order of index.
For instance , if a go routine gives output as {2, "Hello"},{9,"Hey"},{4,"Hola"}, my output file should contain Hello Hola Hey
All these go routines run in parallel and I have no control on the order of execution , hence I am passing the index to finally order the output.