Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 386 for when (0.16 sec)

  1. tests/update_has_one_test.go

    	user := *GetUser("update-has-one", Config{})
    
    	if err := DB.Create(&user).Error; err != nil {
    		t.Fatalf("errors happened when create: %v", err)
    	}
    
    	user.Account = Account{Number: "account-has-one-association"}
    
    	if err := DB.Save(&user).Error; err != nil {
    		t.Fatalf("errors happened when update: %v", err)
    	}
    
    	var user2 User
    	DB.Preload("Account").Find(&user2, "id = ?", user.ID)
    	CheckUser(t, user2, user)
    
    Go
    - Registered: Sun May 05 09:35:13 GMT 2024
    - Last Modified: Thu Jul 14 06:55:54 GMT 2022
    - 3.6K bytes
    - Viewed (0)
  2. tests/associations_has_many_test.go

    		t.Fatalf("Error happened when append pet, got %v", err)
    	}
    
    	if pet2.ID == 0 {
    		t.Fatalf("pet2's ID should be created")
    	}
    
    	user.Pets = []*Pet{&pet2}
    	CheckUser(t, user2, user)
    
    	AssertAssociationCount(t, user2, "Pets", 1, "AfterReplace")
    
    	// Delete
    	if err := DB.Model(&user2).Association("Pets").Delete(&Pet{}); err != nil {
    		t.Fatalf("Error happened when delete pet, got %v", err)
    	}
    Go
    - Registered: Sun May 05 09:35:13 GMT 2024
    - Last Modified: Fri Dec 15 08:36:08 GMT 2023
    - 15.6K bytes
    - Viewed (0)
  3. tests/count_test.go

    		t.Errorf("error should raise when using preload without schema")
    	}
    
    	var count13 int64
    	if err := DB.Model(User{}).
    		Where("name in ?", []string{user1.Name, user2.Name, user3.Name}).
    		Preload("Toys", func(db *gorm.DB) *gorm.DB {
    			return db.Table("toys").Select("name")
    		}).Count(&count13).Error; err != nil {
    		t.Errorf("no error should raise when using count with preload, but got %v", err)
    	}
    Go
    - Registered: Sun May 05 09:35:13 GMT 2024
    - Last Modified: Mon Oct 30 09:15:49 GMT 2023
    - 6.9K bytes
    - Viewed (0)
  4. internal/grid/errors.go

    import (
    	"errors"
    	"fmt"
    )
    
    var (
    	// ErrUnknownHandler is returned when an unknown handler is requested.
    	ErrUnknownHandler = errors.New("unknown mux handler")
    
    	// ErrHandlerAlreadyExists is returned when a handler is already registered.
    	ErrHandlerAlreadyExists = errors.New("mux handler already exists")
    
    	// ErrIncorrectSequence is returned when an out-of-sequence item is received.
    Go
    - Registered: Sun Apr 21 19:28:08 GMT 2024
    - Last Modified: Tue Nov 21 01:09:35 GMT 2023
    - 1.4K bytes
    - Viewed (0)
  5. docs/debugging/inspect/main.go

    	if err != nil {
    		fmt.Printf("error when create private.pem: %s n", err)
    		os.Exit(1)
    	}
    	err = pem.Encode(privatePem, privateKeyBlock)
    	if err != nil {
    		fmt.Printf("error when encode private pem: %s n", err)
    		os.Exit(1)
    	}
    
    	// dump public key to file
    	publicKeyBytes := x509.MarshalPKCS1PublicKey(&privatekey.PublicKey)
    	if err != nil {
    		fmt.Printf("error when dumping publickey: %s n", err)
    		os.Exit(1)
    Go
    - Registered: Sun Apr 28 19:28:10 GMT 2024
    - Last Modified: Thu Apr 11 21:22:47 GMT 2024
    - 4.8K bytes
    - Viewed (0)
  6. tests/create_test.go

    			t.Fatalf("errors happened when create: %v", err)
    		}
    
    		for _, pet := range pets {
    			CheckPet(t, *pet, *pet)
    		}
    	})
    }
    
    func TestCreateEmptyStruct(t *testing.T) {
    	type EmptyStruct struct {
    		ID uint
    	}
    	DB.Migrator().DropTable(&EmptyStruct{})
    
    	if err := DB.AutoMigrate(&EmptyStruct{}); err != nil {
    		t.Errorf("no error should happen when auto migrate, but got %v", err)
    	}
    
    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)
  7. tests/embedded_struct_test.go

    		t.Errorf("no error should happen when query with embedded struct, but got %v", err)
    	} else if egNews.BasePost.Title != "engadget_news" {
    		t.Errorf("embedded struct's value should be scanned correctly")
    	}
    
    	var egPosts []EngadgetPost
    	if err := DB.Order("author_name asc").Find(&egPosts).Error; err != nil {
    		t.Fatalf("no error should happen when query with embedded struct, but got %v", err)
    	}
    Go
    - Registered: Sun May 05 09:35:13 GMT 2024
    - Last Modified: Thu Oct 26 03:58:13 GMT 2023
    - 7.3K bytes
    - Viewed (0)
  8. cmd/storage-datatypes.go

    	// DataDir of the file
    	DataDir string `msg:"dd"`
    
    	// Indicates if this object is still in V1 format.
    	XLV1 bool `msg:"v1"`
    
    	// Date and time when the file was last modified, if Deleted
    	// is 'true' this value represents when while was deleted.
    	ModTime time.Time `msg:"mt"`
    
    	// Total file size.
    	Size int64 `msg:"sz"`
    
    	// File mode bits.
    	Mode uint32 `msg:"m"`
    
    Go
    - Registered: Sun Apr 28 19:28:10 GMT 2024
    - Last Modified: Tue Apr 23 17:15:52 GMT 2024
    - 15.3K bytes
    - Viewed (0)
  9. cni/pkg/nodeagent/ztunnelserver.go

    	so that we can remove stale entries when the ztunnel pod is deleted
    	or when the ztunnel pod is restarted in the same pod (remove old entries when the same uid connects again, but with different boot id?)
    
    	save a queue of what needs to be sent to the ztunnel pod and send it one by one when it connects.
    
    	when a new ztunnel connects with different uid, only propagate deletes to older ztunnels.
    */
    
    Go
    - Registered: Wed May 01 22:53:12 GMT 2024
    - Last Modified: Fri Apr 12 21:47:31 GMT 2024
    - 12.4K bytes
    - Viewed (0)
  10. cmd/os_unix.go

    	}
    	switch dirent.Type {
    	case syscall.DT_REG:
    		typ = 0
    	case syscall.DT_DIR:
    		typ = os.ModeDir
    	case syscall.DT_LNK:
    		typ = os.ModeSymlink
    	default:
    		// Skip all other file types. Revisit if/when this code needs
    		// to handle such files, MinIO is only interested in
    		// files and directories.
    		typ = unexpectedFileMode
    	}
    
    	nameBuf := (*[unsafe.Sizeof(dirent.Name)]byte)(unsafe.Pointer(&dirent.Name[0]))
    Go
    - Registered: Sun Apr 28 19:28:10 GMT 2024
    - Last Modified: Thu Jan 18 07:03:17 GMT 2024
    - 9.3K bytes
    - Viewed (0)
Back to top