MCPcopy Create free account
hub / github.com/Pallinder/go-randomdata / IpV4Address

Function IpV4Address

random_data.go:337–345  ·  view source on GitHub ↗

IpV4Address returns a valid IPv4 address as string

()

Source from the content-addressed store, hash-verified

335
336// IpV4Address returns a valid IPv4 address as string
337func IpV4Address() string {
338 blocks := []string{}
339 for i := 0; i < 4; i++ {
340 number := privateRand.Intn(255)
341 blocks = append(blocks, strconv.Itoa(number))
342 }
343
344 return strings.Join(blocks, ".")
345}
346
347// IpV6Address returns a valid IPv6 address as net.IP
348func IpV6Address() string {

Callers 2

TestIpV4AddressFunction · 0.85
ExampleRandomdataFunction · 0.85

Calls 1

IntnMethod · 0.80

Tested by 2

TestIpV4AddressFunction · 0.68
ExampleRandomdataFunction · 0.68

Used in the wild real call sites across dependent graphs

searching dependent graphs…