Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 1 of 1 for TestSetAndGet (0.21 sec)

  1. tests/main_test.go

    		t.Errorf("Should got error with invalid SQL")
    	}
    
    	DB.Model(&User{}).Count(&count2)
    	if count1 != count2 {
    		t.Errorf("No user should not be deleted by invalid SQL")
    	}
    }
    
    func TestSetAndGet(t *testing.T) {
    	if value, ok := DB.Set("hello", "world").Get("hello"); !ok {
    		t.Errorf("Should be able to get setting after set")
    	} else if value.(string) != "world" {
    		t.Errorf("Set value should not be changed")
    	}
    Go
    - Registered: Sun May 05 09:35:13 GMT 2024
    - Last Modified: Thu Mar 24 01:31:58 GMT 2022
    - 1.4K bytes
    - Viewed (0)
Back to top