Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 3 of 3 for describeConflict (0.39 sec)

  1. src/net/http/pattern.go

    func isLitOrSingle(seg segment) bool {
    	if seg.wild {
    		return !seg.multi
    	}
    	return seg.s != "/"
    }
    
    // describeConflict returns an explanation of why two patterns conflict.
    func describeConflict(p1, p2 *pattern) string {
    	mrel := p1.compareMethods(p2)
    	prel := p1.comparePaths(p2)
    	rel := combineRelationships(mrel, prel)
    	if rel == equivalent {
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Mon Feb 26 16:36:30 UTC 2024
    - 15.3K bytes
    - Viewed (0)
  2. src/net/http/pattern_test.go

    		{"GET /a", "HEAD /", "matches more methods than HEAD /, but has a more specific path pattern"},
    		{"POST /", "/a", "matches fewer methods than /a, but has a more general path pattern"},
    	} {
    		got := describeConflict(mustParsePattern(t, test.p1), mustParsePattern(t, test.p2))
    		if !strings.Contains(got, test.want) {
    			t.Errorf("%s vs. %s:\ngot:\n%s\nwhich does not contain %q",
    				test.p1, test.p2, got, test.want)
    		}
    	}
    }
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Mon Feb 26 16:36:30 UTC 2024
    - 15K bytes
    - Viewed (0)
  3. src/net/http/server.go

    	}
    
    	mux.mu.Lock()
    	defer mux.mu.Unlock()
    	// Check for conflict.
    	if err := mux.index.possiblyConflictingPatterns(pat, func(pat2 *pattern) error {
    		if pat.conflictsWith(pat2) {
    			d := describeConflict(pat, pat2)
    			return fmt.Errorf("pattern %q (registered at %s) conflicts with pattern %q (registered at %s):\n%s",
    				pat, pat.loc, pat2, pat2.loc, d)
    		}
    		return nil
    	}); err != nil {
    		return err
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Fri Jun 07 17:57:01 UTC 2024
    - 123.4K bytes
    - Viewed (0)
Back to top