func (p PortRange) SanitizeBounds() PortRange {
	res := p
	if res.Protocol == "icmp" {
		return res
	}
	if res.FromPort > res.ToPort {
		res.FromPort, res.ToPort = res.ToPort, res.FromPort
	}
	for _, bound := range []*int{&res.FromPort, &res.ToPort} {
		switch {
		case *bound <= 0:
			*bound = 1
		case *bound > 65535:
			*bound = 65535
		}
	}
	return res
}
// SanitizeBounds returns a copy of the port range, which is guaranteed to have
// FromPort >= ToPort and both FromPort and ToPort fit into the valid range
// from 1 to 65535, inclusive.
SanitizeBounds returns a copy of the port range, which is guaranteed to have
FromPort >= ToPort and both FromPort and ToPort fit into the valid range
from 1 to 65535, inclusive.
// SanitizeBounds returns a copy of the port range which is guaranteed to have // FromPort > = ToPort and both FromPort and ToPort fit into the valid range // from 1 to 65535 inclusive .
func (p PortRange) SanitizeBounds() PortRange {
	res := p
	if res.Protocol == "icmp" {
		return res
	}
	if res.FromPort > res.ToPort {
		res.FromPort, res.ToPort = res.ToPort, res.FromPort
	}
	for _, bound := range []*int{&res.FromPort, &res.ToPort} {
		switch {
		case *bound <= 0:
			*bound = 1
		case *bound > 65535:
			*bound = 65535
		}
	}
	return res
}
func ( p PortRange ) SanitizeBounds ( ) PortRange { res := p if res . Protocol == " " { return res } if res . FromPort > res . ToPort { res . FromPort , res . ToPort = res . ToPort , res . FromPort } for _ , bound := range [ ] * int { & res . FromPort , & res . ToPort } { switch { case * bound <= 0 : * bound = 1 case * bound > 65535 : * bound = 65535 } } return res }
SanitizeBounds returns a copy of the port range, which is guaranteed to have
FromPort >= ToPort and both FromPort and ToPort fit into the valid range
from 1 to 65535, inclusive.
SanitizeBounds returns a copy of the port range which is guaranteed to have FromPort > = ToPort and both FromPort and ToPort fit into the valid range from 1 to 65535 inclusive .