Files
Roland.Ma 7bb8124a61 pin dependencies
Signed-off-by: Roland.Ma <rolandma@yunify.com>
2021-08-27 06:37:31 +00:00

13 lines
214 B
Go

package sprig
import (
"math/rand"
"net"
)
func getHostByName(name string) string {
addrs, _ := net.LookupHost(name)
//TODO: add error handing when release v3 cames out
return addrs[rand.Intn(len(addrs))]
}