ceph-csi/vendor/github.com/go-task/slim-sprig/v3/network.go

13 lines
214 B
Go
Raw Normal View History

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