Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 3 of 3 for exists (0.33 sec)

  1. callbacks.go

    			return true
    		}
    		if cs[j].after == "*" && cs[i].after != "*" {
    			return true
    		}
    		return false
    	})
    
    	for _, c := range cs {
    		// show warning message the callback name already exists
    		if idx := getRIndex(names, c.name); idx > -1 && !c.replace && !c.remove && !cs[idx].remove {
    			c.processor.db.Logger.Warn(context.Background(), "duplicated callback `%s` from %s\n", c.name, utils.FileWithLineNum())
    		}
    Go
    - Registered: Sun May 05 09:35:13 GMT 2024
    - Last Modified: Tue Mar 26 03:33:36 GMT 2024
    - 8.6K bytes
    - Viewed (1)
  2. callbacks/helper_test.go

    		t.Fatalf("loaded should be false")
    	}
    
    	if loaded = loadOrStoreVisitMap(&vm, reflect.ValueOf(&t1)); !loaded {
    		t.Fatalf("loaded should be true")
    	}
    
    	// t1 already exist but t2 not
    	if loaded = loadOrStoreVisitMap(&vm, reflect.ValueOf([]*testM{&t1, &t2, &t3})); loaded {
    		t.Fatalf("loaded should be false")
    	}
    
    Go
    - Registered: Sun May 05 09:35:13 GMT 2024
    - Last Modified: Tue Mar 05 02:22:57 GMT 2024
    - 3.4K bytes
    - Viewed (0)
  3. utils/utils_test.go

    		}
    	}
    }
    
    func TestContains(t *testing.T) {
    	containsTests := []struct {
    		name  string
    		elems []string
    		elem  string
    		out   bool
    	}{
    		{"exists", []string{"1", "2", "3"}, "1", true},
    		{"not exists", []string{"1", "2", "3"}, "4", false},
    	}
    	for _, test := range containsTests {
    		t.Run(test.name, func(t *testing.T) {
    			if out := Contains(test.elems, test.elem); test.out != out {
    Go
    - Registered: Sun May 05 09:35:13 GMT 2024
    - Last Modified: Mon Feb 19 03:42:25 GMT 2024
    - 3.6K bytes
    - Viewed (0)
Back to top