Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 663 for unquote (0.29 sec)

  1. src/strconv/example_test.go

    	// "'☺'", <nil>
    }
    
    func ExampleUnquote() {
    	s, err := strconv.Unquote("You can't unquote a string without quotes")
    	fmt.Printf("%q, %v\n", s, err)
    	s, err = strconv.Unquote("\"The string must be either double-quoted\"")
    	fmt.Printf("%q, %v\n", s, err)
    	s, err = strconv.Unquote("`or backquoted.`")
    	fmt.Printf("%q, %v\n", s, err)
    	s, err = strconv.Unquote("'\u263a'") // single character only allowed in single quotes
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Fri Oct 13 22:57:37 UTC 2023
    - 8.9K bytes
    - Viewed (0)
  2. src/strconv/quote.go

    	out, _, err := unquote(s, false)
    	return out, err
    }
    
    // Unquote interprets s as a single-quoted, double-quoted,
    // or backquoted Go string literal, returning the string value
    // that s quotes.  (If s is single-quoted, it would be a Go
    // character literal; Unquote returns the corresponding
    // one-character string.)
    func Unquote(s string) (string, error) {
    	out, rem, err := unquote(s, true)
    	if len(rem) > 0 {
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu Apr 04 14:21:28 UTC 2024
    - 16.5K bytes
    - Viewed (0)
  3. src/strconv/doc.go

    // return quoted Go rune literals.
    //
    // [Unquote] and [UnquoteChar] unquote Go string and rune literals.
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu Apr 04 14:21:28 UTC 2024
    - 1.9K bytes
    - Viewed (0)
  4. src/cmd/go/testdata/vcstest/hg/hgrepo1.txt

    # head of the default branch.
    hg update -r 4
    
    hg branch v3
    unquote ''
    cp stdout dummy
    hg add dummy
    hg commit --user 'Russ Cox <******@****.***>' --date '2018-06-27T12:15:45-04:00' -m 'dummy'
    
    hg update v2.3.4
    hg branch v2.3.4
    unquote ''
    cp stdout dummy
    hg add dummy
    hg commit --user 'Russ Cox <******@****.***>' --date '2018-06-27T12:16:10-04:00' -m 'dummy'
    
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Tue Oct 25 16:48:06 UTC 2022
    - 4.3K bytes
    - Viewed (0)
  5. src/cmd/go/testdata/script/test_fuzz_minimize_dirty_cov.txt

    	if err != nil {
    		return false, err
    	}
    	for _, line := range bytes.Split(data, []byte("\n")) {
    		m := valRe.FindSubmatch(line)
    		if m == nil {
    			continue
    		}
    		fmt.Println(strconv.Unquote(string(m[1])))
    		if s, err := strconv.Unquote(string(m[1])); err != nil {
    			return false, err
    		} else if s == expected {
    			return true, nil
    		}
    	}
    	return false, nil
    }
    
    var valRe = regexp.MustCompile(`^\[\]byte\(([^)]+)\)$`)
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Wed Sep 27 01:16:19 UTC 2023
    - 1.9K bytes
    - Viewed (0)
  6. src/strconv/quote_test.go

    	}
    	for _, tt := range tests {
    		testUnquote(t, tt.in, tt.want, tt.wantErr)
    	}
    }
    
    func testUnquote(t *testing.T, in, want string, wantErr error) {
    	// Test Unquote.
    	got, gotErr := Unquote(in)
    	if got != want || gotErr != wantErr {
    		t.Errorf("Unquote(%q) = (%q, %v), want (%q, %v)", in, got, gotErr, want, wantErr)
    	}
    
    	// Test QuotedPrefix.
    	// Adding an arbitrary suffix should not change the result of QuotedPrefix
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu Mar 31 20:37:15 UTC 2022
    - 9.6K bytes
    - Viewed (0)
  7. src/cmd/go/testdata/vcstest/git/gitrepo1.txt

    handle git
    
    env GIT_AUTHOR_NAME='Russ Cox'
    env GIT_AUTHOR_EMAIL='******@****.***'
    env GIT_COMMITTER_NAME=$GIT_AUTHOR_NAME
    env GIT_COMMITTER_EMAIL=$GIT_AUTHOR_EMAIL
    
    git init
    
    at 2018-04-17T15:43:22-04:00
    unquote ''
    cp stdout README
    git add README
    git commit -a -m 'empty README'
    git branch -m master
    git tag v1.2.3
    
    at 2018-04-17T15:45:48-04:00
    git branch v2
    git checkout v2
    echo 'v2'
    cp stdout v2
    git add v2
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Tue Oct 25 15:36:24 UTC 2022
    - 1.6K bytes
    - Viewed (0)
  8. src/cmd/go/internal/vcweb/script.go

    }
    
    func scriptUnquote() script.Cmd {
    	return script.Command(
    		script.CmdUsage{
    			Summary: "unquote the argument as a Go string",
    			Args:    "string",
    		},
    		func(st *script.State, args ...string) (script.WaitFunc, error) {
    			if len(args) != 1 {
    				return nil, script.ErrUsage
    			}
    
    			s, err := strconv.Unquote(`"` + args[0] + `"`)
    			if err != nil {
    				return nil, err
    			}
    
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Tue Nov 08 19:37:03 UTC 2022
    - 9K bytes
    - Viewed (0)
  9. src/cmd/go/testdata/script/test_fuzz_minimize_interesting.txt

    		}
    		var containsVal bool
    		for _, line := range bytes.Split(data, []byte("\n")) {
    			m := valRe.FindSubmatch(line)
    			if m == nil {
    				continue
    			}
    			containsVal = true
    			s, err := strconv.Unquote(string(m[1]))
    			if err != nil {
    				panic(err)
    			}
    			if len(s) != wantLen {
    				fmt.Fprintf(os.Stderr, "expect length %d, got %d (%q)\n", wantLen, len(s), line)
    				os.Exit(1)
    			}
    		}
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Tue Sep 05 23:35:32 UTC 2023
    - 5.5K bytes
    - Viewed (0)
  10. src/go/types/errorcalls_test.go

    				return false
    			}
    			format := call.Args[errorfFormatIndex]
    			ast.Inspect(format, func(n ast.Node) bool {
    				if lit, _ := n.(*ast.BasicLit); lit != nil && lit.Kind == token.STRING {
    					if s, err := strconv.Unquote(lit.Value); err == nil {
    						if !balancedParentheses(s) {
    							t.Errorf("%s: unbalanced parentheses/brackets", fset.Position(lit.ValuePos))
    						}
    					}
    					return false
    				}
    				return true
    			})
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Fri Dec 15 21:57:36 UTC 2023
    - 2.2K bytes
    - Viewed (0)
Back to top