You are an expert in writing code in many different languages. Your goal is to perform code completion for the following code, keeping in mind the rest of the code and the file meta data.
    Metadata details:
    filename: ipaddrs.go
    path of file: ./repos/teller/vendor/github.com/hashicorp/go-sockaddr
    
    the code of the file until where you have to start completion: package sockaddr

import "bytes"

type IPAddrs []IPAddr

func (s IPAddrs) Len() int      { return len(s) }
func (s IPAddrs) Swap(i, j int) { s[i], s[j] = s[j], s[i] }

// // SortIPAddrsByCmp is a type that satisfie
    
func (s SortIPAddrsByNetworkSize) Less(i, j int) bool {
	// Sort masks with a larger binary value (i.e. fewer hosts per network
	// prefix) after masks with a smaller value (larger number of hosts per
	// prefix).
	switch bytes.Compare([]byte(*s.IPAddrs[i].NetIPMask()), []byte(*s.IPAddrs[j].NetIPMask())) {
	case 0:
		// Fall through to the second test if the net.IPMasks are the
		// same.
		break
	case 1:
		return true
	case -1:
		return false
	default:
		panic("bad, m'kay?")
	}

	// Sort IPs based on the length (i.e. prefer IPv4 over IPv6).
	iLen := len(*s.IPAddrs[i].NetIP())
	jLen := len(*s.IPAddrs[j].NetIP())
	if iLen != jLen {
		return iLen > jLen
	}

	// Sort IPs based on their network address from lowest to highest.
	switch bytes.Compare(s.IPAddrs[i].NetIPNet().IP, s.IPAddrs[j].NetIPNet().IP) {
	case 0:
		break
	case 1:
		return false
	case -1:
		return true
	default:
		panic("lol wut?")
	}

	// If a host does not have a port set, it always sorts after hosts
	// that have a port (e.g. a host with a /32 and port number is more
	// specific and should sort first over a host with a /32 but no port
	// set).
	if s.IPAddrs[i].IPPort() == 0 || s.IPAddrs[j].IPPort() == 0 {
		return false
	}
	return s.IPAddrs[i].IPPort() < s.IPAddrs[j].IPPort()
}