Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 2 of 2 for isDotSlash (0.27 sec)

  1. src/cmd/doc/main.go

    // of error is minute and even on Windows people will use ./
    // sometimes.
    var dotPaths = []string{
    	`./`,
    	`../`,
    	`.\`,
    	`..\`,
    }
    
    // isDotSlash reports whether the path begins with a reference
    // to the local . or .. directory.
    func isDotSlash(arg string) bool {
    	if arg == "." || arg == ".." {
    		return true
    	}
    	for _, dotPath := range dotPaths {
    		if strings.HasPrefix(arg, dotPath) {
    			return true
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Tue May 14 19:41:17 UTC 2024
    - 12.2K bytes
    - Viewed (0)
  2. src/cmd/doc/doc_test.go

    	{`../`, true},
    	{`..\`, true},
    	{`../x`, true},
    	{`..\x`, true},
    }
    
    func TestIsDotSlashPath(t *testing.T) {
    	for _, test := range isDotSlashTests {
    		if result := isDotSlash(test.str); result != test.result {
    			t.Errorf("isDotSlash(%q) = %t; expected %t", test.str, result, test.result)
    		}
    	}
    }
    
    type test struct {
    	name string
    	args []string // Arguments to "[go] doc".
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu Sep 07 19:16:55 UTC 2023
    - 31.2K bytes
    - Viewed (0)
Back to top