Codebase list golang-github-go-kit-kit / 3b9658d9-4065-4804-9af8-16961c419f60/v0.8.0 transport / amqp / util.go
3b9658d9-4065-4804-9af8-16961c419f60/v0.8.0

Tree @3b9658d9-4065-4804-9af8-16961c419f60/v0.8.0 (Download .tar.gz)

util.go @3b9658d9-4065-4804-9af8-16961c419f60/v0.8.0raw · history · blame

package amqp

import (
	"math/rand"
)

func randomString(l int) string {
	bytes := make([]byte, l)
	for i := 0; i < l; i++ {
		bytes[i] = byte(randInt(65, 90))
	}
	return string(bytes)
}

func randInt(min int, max int) int {
	return min + rand.Intn(max-min)
}