type PortRange … // Contains tests whether a given port falls within the PortRange. func (pr *PortRange) Contains(p int) bool { … } // String converts the PortRange to a string representation, which can be // parsed by PortRange.Set or ParsePortRange. func (pr PortRange) String() string { … } // Set parses a string of the form "value", "min-max", or "min+offset", inclusive at both ends, and // sets the PortRange from it. This is part of the flag.Value and pflag.Value // interfaces. func (pr *PortRange) Set(value string) error { … } // Type returns a descriptive string about this type. This is part of the // pflag.Value interface. func (*PortRange) Type() string { … } // ParsePortRange parses a string of the form "min-max", inclusive at both // ends, and initializes a new PortRange from it. func ParsePortRange(value string) (*PortRange, error) { … } func ParsePortRangeOrDie(value string) *PortRange { … }