summaryrefslogtreecommitdiff
path: root/vendor/github.com/go-task/slim-sprig/network.go
blob: 108d78a94627cd8f52113bed818a0b8749243700 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
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))]
}