code: func ParsePortRange(s string) (*PortRange, error) {
  	if s == "*" {
  		return &PortRange{Min: 0, Max: 65535}, nil
  	}
  
  	minmax := strings.Split(s, "-")
  	switch len(minmax) {
  	case 1:
  		port, err := strconv.Atoi(s)
  		if err != nil {
  			return nil, err
  		}
  		if port < 0 || port > 65535 {
  			return nil, fmt.Errorf("invalid port: %s", s)
  		}
  		return &PortRange{Min: port, Max: port}, nil
  	case 2:
  		min, err := strconv.Atoi(minmax[0])
  		if err != nil {
  			return nil, err
  		}
  		max, err := strconv.Atoi(minmax[1])
  		if err != nil {
  			return nil, err
  		}
  
  		realmin := maxint(0, minint(min, max))
  		realmax := minint(65535, maxint(min, max))
  
  		return &PortRange{Min: realmin, Max: realmax}, nil
  	default:
  		return nil, fmt.Errorf("invalid range: %s", s)
  	}
  }
docs: // ParsePortRange parses the s to a PortRange.
  // The s may be a '*' means 0-65535.