Sorry, but I do not really understand your requirements.
Could you please write a small program on the playground which shows your input data and how you want to process it or at least how the expected data should look like (in go syntax)?
My requirement -I need to get ContinuityCounter values from video based on pid(packet identifier) and Validated pid has proper ContinuityCounter values.
m := make(map[uint16]uint8)
m[pid] = cc
fmt.Println("map:", m)
Above code pid will return 8191,17 values and cc(ContinuityCounter) will return 1,6,7,7 values.So i have created map to find ContinuityCounter based on pid which will retrun below results.
map: map[17:1]
map: map[8191:6]
map: map[8191:7]
map: map[8191:7]
map: map[17:2]
from that i need to split cc values based on pid. Since code is huge , I couldn’t post.
In your code nothing is returned, but printed only.
Also since you only showed a single snippet which only initialises the map with a single KV-pair and printing it once, I have to assume, that on each iteration the previous map is lost.
Based on this assumptions you can not do anything with the history.
Start with actually implementing a proper history.
Still I do not really get what you want.
Therefore I ask again, if you can show in a proper playground what your input is, and what your expected output is.
And again, please use proper go code to describe your actual and expected data, not some pseudo-debug output that doesn’t tell anything.
Please correct me if I am wrong.
You need something like this in the end
So, you need to store the values in the slice previously LIKE https://play.golang.org/p/0h9NE2PVt3b
From this i need to split key 8191 and 17 values separately and need to find difference between its values
For Example
map: map[8191:0]
map: map[8191:1]
map: map[8191:2]
map: map[8191:2]