Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 1 of 1 for SelectUser1 (0.14 sec)

  1. tests/query_test.go

    		t.Errorf("got error when pluck time: %v", err)
    	}
    
    	for idx, tv := range nulltimes {
    		AssertEqual(t, tv.Time, users[idx].CreatedAt)
    	}
    }
    
    func TestSelect(t *testing.T) {
    	user := User{Name: "SelectUser1"}
    	DB.Save(&user)
    
    	var result User
    	DB.Where("name = ?", user.Name).Select("name").Find(&result)
    	if result.ID != 0 {
    		t.Errorf("Should not have ID because only selected name, %+v", result.ID)
    	}
    
    Registered: Sun Nov 03 09:35:10 UTC 2024
    - Last Modified: Mon Jun 24 09:42:59 UTC 2024
    - 50.4K bytes
    - Viewed (0)
Back to top