4 ms·
If you added a trivial wait of random length before each response, mightn't you see non-alternating behavior at times?
by Cyranix 14y ago
If you added a trivial wait of random length before each response, mightn't you see non-alternating behavior at times?
- gizzlon 14y agoNot GP, but I also saw this.. Increasing the timeout to 0><10 seconds does give the expected output.. But shouldn't I see this from time-to-time with 1 second as well? Hmm..
- gizzlon 14y agoMy rand.Intn() was always returning the same value. Seem like you have to to seed it manually (once, in main() for example): rand.Seed( time.Now().UTC().UnixNano()) http://stackoverflow.com/questions/12321133/golang-random-number-generator-how-to-seed-properly http://stackoverflow.com/questions/12321133/golang-random-nu... Edit: It's in the documentation, but you have to look for it. "Seed uses the provided seed value to initialize the generator to a deterministic state. If Seed is not called, the generator behaves as if seeded by Seed(1)"