int32 and time.Duration are different types. You need to convert the int32 to a time.Duration:
time.Sleep(time.Duration(rand.Int31n(1000)) * time.Millisecond)
int32 and time.Duration are different types. You need to convert the int32 to a time.Duration:
time.Sleep(time.Duration(rand.Int31n(1000)) * time.Millisecond)