Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 1 of 1 for mapvalues (0.18 sec)

  1. tests/create_test.go

    	}
    
    	// case 1: one record, create from map[string]interface{}
    	mapValue1 := map[string]interface{}{"name": "create_from_map_with_schema1", "age": 1}
    	if err := DB.Model(&User{}).Create(mapValue1).Error; err != nil {
    		t.Fatalf("failed to create data from map, got error: %v", err)
    	}
    
    	if _, ok := mapValue1["id"]; !ok {
    		t.Fatal("failed to create data from map with table, returning map has no primary key")
    	}
    Go
    - Registered: Sun May 05 09:35:13 GMT 2024
    - Last Modified: Tue Mar 19 03:50:28 GMT 2024
    - 26.4K bytes
    - Viewed (0)
Back to top