For Dan: I have an idea that the cause is in the runtime function mapiternext. The runtime calls mapiternext function to choose next bucket to iterate by index, if we put a key-value into a bucket which already be iterated, then the for-range will not iterate it again, so the new key-value will not be printed. But I don't know this idea is true or false. 在2020年11月11日星期三 UTC+8 上午11:16:41<kortschak> 写道:
> On Tue, 2020-11-10 at 19:08 -0800, 'Kilos' via golang-nuts wrote: > > Thanks for reply, but I want to know the underlying reason about it, > > I think the reason is in how the runtime functions works. > > The direct cause is that the hash function used for the map > implementation is seeded from the system clock. > > The reason for doing this was largely to avoid time complexity attacks > against servers that use maps for passing arguments in URIs. > > > -- 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/22d304e0-2503-4c35-8cbc-7f548d9becd4n%40googlegroups.com.