MCPcopy Create free account
hub / github.com/coder/envbox / mustParseIPv4Net

Function mustParseIPv4Net

dockerutil/network.go:18–27  ·  view source on GitHub ↗
(s string)

Source from the content-addressed store, hash-verified

16}
17
18func mustParseIPv4Net(s string) *net.IPNet {
19 _, n, err := net.ParseCIDR(s)
20 if err != nil {
21 panic(err)
22 }
23 if n.IP.To4() == nil {
24 panic(xerrors.New("must specify an IPv4 network"))
25 }
26 return n
27}
28
29// Adapted from https://gist.github.com/udhos/b468fbfd376aa0b655b6b0c539a88c03#file-nextip-go-L31
30func mustNextIPv4(ip net.IP, inc int) net.IP {

Callers 1

BridgeIPFromCIDRFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected