Codebase list golang-github-go-kit-kit / d2f2902b-79c4-43cd-8c09-341e33fc6017/v0.11.0 transport / amqp / util.go
d2f2902b-79c4-43cd-8c09-341e33fc6017/v0.11.0

Tree @d2f2902b-79c4-43cd-8c09-341e33fc6017/v0.11.0 (Download .tar.gz)

util.go @d2f2902b-79c4-43cd-8c09-341e33fc6017/v0.11.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)
}