rand.Intn(math.MaxInt64) causes tests to fail on 32-bit architectures. Use the simpler rand.Int() instead, which still provides plenty of room for generating pseudo-random test usernames.