func GetRawPathAndOptions(value string) (string, map[string]string, error) {
	value = strings.TrimSpace(value)
	if value == "" {
		return "", nil, newValueEmptyError()
	}

	switch splitValue := strings.Split(value, "#"); len(splitValue) {
	case 1:
		return value, nil, nil
	case 2:
		path := strings.TrimSpace(splitValue[0])
		optionsString := strings.TrimSpace(splitValue[1])
		if path == "" {
			return "", nil, newValueStartsWithHashtagError(value)
		}
		if optionsString == "" {
			return "", nil, newValueEndsWithHashtagError(value)
		}
		options := make(map[string]string)
		for _, pair := range strings.Split(optionsString, ",") {
			split := strings.Split(pair, "=")
			if len(split) != 2 {
				return "", nil, newOptionsInvalidError(optionsString)
			}
			key := strings.TrimSpace(split[0])
			value := strings.TrimSpace(split[1])
			if key == "" || value == "" {
				return "", nil, newOptionsInvalidError(optionsString)
			}
			if _, ok := options[key]; ok {
				return "", nil, newOptionsDuplicateKeyError(key)
			}
			options[key] = value
		}
		return path, options, nil
	default:
		return "", nil, newValueMultipleHashtagsError(value)
	}
}
// GetRawPathAndOptions returns the raw path and options from the value provided,
// the rawPath will be non-empty when returning without error here.
GetRawPathAndOptions returns the raw path and options from the value provided,
the rawPath will be non-empty when returning without error here.
// GetRawPathAndOptions returns the raw path and options from the value provided // the rawPath will be non - empty when returning without error here .
func GetRawPathAndOptions(value string) (string, map[string]string, error) {
	value = strings.TrimSpace(value)
	if value == "" {
		return "", nil, newValueEmptyError()
	}
	switch splitValue := strings.Split(value, "#"); len(splitValue) {
	case 1:
		return value, nil, nil
	case 2:
		path := strings.TrimSpace(splitValue[0])
		optionsString := strings.TrimSpace(splitValue[1])
		if path == "" {
			return "", nil, newValueStartsWithHashtagError(value)
		}
		if optionsString == "" {
			return "", nil, newValueEndsWithHashtagError(value)
		}
		options := make(map[string]string)
		for _, pair := range strings.Split(optionsString, ",") {
			split := strings.Split(pair, "=")
			if len(split) != 2 {
				return "", nil, newOptionsInvalidError(optionsString)
			}
			key := strings.TrimSpace(split[0])
			value := strings.TrimSpace(split[1])
			if key == "" || value == "" {
				return "", nil, newOptionsInvalidError(optionsString)
			}
			if _, ok := options[key]; ok {
				return "", nil, newOptionsDuplicateKeyError(key)
			}
			options[key] = value
		}
		return path, options, nil
	default:
		return "", nil, newValueMultipleHashtagsError(value)
	}
}
func GetRawPathAndOptions ( value string ) ( string , map [ string ] string , error ) { value = strings . TrimSpace ( value ) if value == " " { return " " , nil , newValueEmptyError ( ) } switch splitValue := strings . Split ( value , " " ) ; len ( splitValue ) { case 1 : return value , nil , nil case 2 : path := strings . TrimSpace ( splitValue [ 0 ] ) optionsString := strings . TrimSpace ( splitValue [ 1 ] ) if path == " " { return " " , nil , newValueStartsWithHashtagError ( value ) } if optionsString == " " { return " " , nil , newValueEndsWithHashtagError ( value ) } options := make ( map [ string ] string ) for _ , pair := range strings . Split ( optionsString , " " ) { split := strings . Split ( pair , " " ) if len ( split ) != 2 { return " " , nil , newOptionsInvalidError ( optionsString ) } key := strings . TrimSpace ( split [ 0 ] ) value := strings . TrimSpace ( split [ 1 ] ) if key == " " || value == " " { return " " , nil , newOptionsInvalidError ( optionsString ) } if _ , ok := options [ key ] ; ok { return " " , nil , newOptionsDuplicateKeyError ( key ) } options [ key ] = value } return path , options , nil default : return " " , nil , newValueMultipleHashtagsError ( value ) } }
GetRawPathAndOptions returns the raw path and options from the value provided,
the rawPath will be non-empty when returning without error here.
GetRawPathAndOptions returns the raw path and options from the value provided the rawPath will be non - empty when returning without error here .