Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 4 of 4 for coerce (0.15 sec)

  1. utils/utils.go

    	"fmt"
    	"path/filepath"
    	"reflect"
    	"runtime"
    	"strconv"
    	"strings"
    	"unicode"
    )
    
    var gormSourceDir string
    
    func init() {
    	_, file, _, _ := runtime.Caller(0)
    	// compatible solution to get gorm source directory with various operating systems
    	gormSourceDir = sourceDir(file)
    }
    
    func sourceDir(file string) string {
    	dir := filepath.Dir(file)
    	dir = filepath.Dir(dir)
    
    	s := filepath.Dir(dir)
    Go
    - Registered: Sun May 05 09:35:13 GMT 2024
    - Last Modified: Mon Apr 22 06:43:02 GMT 2024
    - 3.8K bytes
    - Viewed (0)
  2. tests/transaction_test.go

    				t.Fatalf("No error should raise")
    			}
    
    			if err := tx.First(&User{}, "name = ?", user.Name).Error; err != nil {
    				t.Fatalf("Should find saved record")
    			}
    
    			panic("force panic")
    		})
    	})
    
    	if err := DB.First(&User{}, "name = ?", "transaction-block-3").Error; err == nil {
    		t.Fatalf("Should not find record after panic rollback")
    	}
    }
    
    Go
    - Registered: Sun May 05 09:35:13 GMT 2024
    - Last Modified: Sat Jun 10 13:05:19 GMT 2023
    - 10.9K bytes
    - Viewed (0)
  3. association.go

    					if association.Relationship.Field.FieldType.Kind() == reflect.Struct {
    						assignBacks = append(assignBacks, assignBack{Source: source, Dest: rv.Index(0)})
    					}
    				}
    			case reflect.Struct:
    				association.Error = association.Relationship.Field.Set(association.DB.Statement.Context, source, rv.Addr().Interface())
    
    Go
    - Registered: Sun May 05 09:35:13 GMT 2024
    - Last Modified: Thu May 04 11:30:45 GMT 2023
    - 21.2K bytes
    - Viewed (0)
  4. tests/query_test.go

    	err = DB.Model(&User{}).Where("name = ?", "testname1").Find(&users).Error
    	if err != nil {
    		t.Fatal(err)
    	}
    	if users[0] == nil || users[0].Name != "testname1" {
    		t.Error("users[0] not covere")
    	}
    	if users[1] != nil {
    		t.Error("users[1] should be empty")
    	}
    Go
    - Registered: Sun May 05 09:35:13 GMT 2024
    - Last Modified: Thu Apr 25 12:22:53 GMT 2024
    - 49.8K bytes
    - Viewed (0)
Back to top