func parseQuotedString(input string) (value, rest string, err error) {
	// Use text/scanner to find end of quoted string
	var s scanner.Scanner
	s.Init(strings.NewReader(input))
	s.Mode = scanner.ScanStrings
	s.Whitespace = 0
	var errMsg string
	s.Error = func(s *scanner.Scanner, msg string) {
		// Record first error
		if errMsg == "" {
			errMsg = msg
		}
	}
	tok := s.Scan()
	rest = input[s.Pos().Offset:]
	if s.ErrorCount > 0 {
		return "", rest, errors.Errorf("parsing quoted string: %s", errMsg)
	}
	if tok != scanner.String {
		// Shouldn't happen; we only asked for strings
		return "", rest, errors.Errorf("parsing quoted string: unexpected token %s", scanner.TokenString(tok))
	}

	// And then strconv to unquote it (oddly, text/scanner doesn't unquote)
	unquoted, err := strconv.Unquote(s.TokenText())
	if err != nil {
		// Shouldn't happen; scanner should only return valid quoted strings
		return "", rest, errors.Errorf("parsing quoted string: %v", err)
	}
	return unquoted, rest, nil
}
// parseQuotedString parses a string name=value argument, returning the
// unquoted value and the remainder of the string.
parseQuotedString parses a string name=value argument, returning the
unquoted value and the remainder of the string.
// parseQuotedString parses a string name = value argument returning the // unquoted value and the remainder of the string .
func parseQuotedString(input string) (value, rest string, err error) {
	var s scanner.Scanner
	s.Init(strings.NewReader(input))
	s.Mode = scanner.ScanStrings
	s.Whitespace = 0
	var errMsg string
	s.Error = func(s *scanner.Scanner, msg string) {
		if errMsg == "" {
			errMsg = msg
		}
	}
	tok := s.Scan()
	rest = input[s.Pos().Offset:]
	if s.ErrorCount > 0 {
		return "", rest, errors.Errorf("parsing quoted string: %s", errMsg)
	}
	if tok != scanner.String {
		return "", rest, errors.Errorf("parsing quoted string: unexpected token %s", scanner.TokenString(tok))
	}
	unquoted, err := strconv.Unquote(s.TokenText())
	if err != nil {
		return "", rest, errors.Errorf("parsing quoted string: %v", err)
	}
	return unquoted, rest, nil
}
func parseQuotedString ( input string ) ( value , rest string , err error ) { var s scanner . Scanner s . Init ( strings . NewReader ( input ) ) s . Mode = scanner . ScanStrings s . Whitespace = 0 var errMsg string s . Error = func ( s * scanner . Scanner , msg string ) { if errMsg == " " { errMsg = msg } } tok := s . Scan ( ) rest = input [ s . Pos ( ) . Offset : ] if s . ErrorCount > 0 { return " " , rest , errors . Errorf ( " " , errMsg ) } if tok != scanner . String { return " " , rest , errors . Errorf ( " " , scanner . TokenString ( tok ) ) } unquoted , err := strconv . Unquote ( s . TokenText ( ) ) if err != nil { return " " , rest , errors . Errorf ( " " , err ) } return unquoted , rest , nil }
parseQuotedString parses a string name=value argument, returning the
unquoted value and the remainder of the string.
parseQuotedString parses a string name = value argument returning the unquoted value and the remainder of the string .
// Use text/scanner to find end of quoted string // Record first error // Shouldn't happen; we only asked for strings // And then strconv to unquote it (oddly, text/scanner doesn't unquote) // Shouldn't happen; scanner should only return valid quoted strings