Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 1 of 1 for TestFindOrInitialize (0.11 sec)

  1. tests/upsert_test.go

    	if err := DB.First(&result2, "code = ?", lang.Code).Error; err != nil {
    		t.Errorf("Failed to query lang, got error %v", err)
    	} else {
    		AssertEqual(t, result2, lang)
    	}
    }
    
    func TestFindOrInitialize(t *testing.T) {
    	var user1, user2, user3, user4, user5, user6 User
    	if err := DB.Where(&User{Name: "find or init", Age: 33}).FirstOrInit(&user1).Error; err != nil {
    Registered: Sun Nov 03 09:35:10 UTC 2024
    - Last Modified: Mon Sep 05 07:39:19 UTC 2022
    - 11.4K bytes
    - Viewed (0)
Back to top