Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 1 of 1 for RegisterBoolVar (0.32 sec)

  1. pkg/env/var_test.go

    func TestBool(t *testing.T) {
    	reset()
    
    	ev := RegisterBoolVar(testVar, true, "")
    	v, present := ev.Lookup()
    	if !v {
    		t.Errorf("Expected true, got %v", v)
    	}
    	if present {
    		t.Errorf("Expected not present")
    	}
    
    	v = ev.Get()
    	if !v {
    		t.Errorf("Expected true, got %v", v)
    	}
    
    	_ = os.Setenv(testVar, "XXX")
    
    	ev = RegisterBoolVar(testVar, true, "")
    	v, present = ev.Lookup()
    	if !v {
    Registered: Fri Jun 14 15:00:06 UTC 2024
    - Last Modified: Tue Aug 08 16:43:05 UTC 2023
    - 8.1K bytes
    - Viewed (0)
Back to top