Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 40 for Book (0.04 sec)

  1. tests/soft_delete_test.go

    	}
    
    	book := SoftDeleteBook{Name: "jinzhu", Pages: 10}
    	DB.Save(&book)
    
    	var count int64
    	if DB.Model(&SoftDeleteBook{}).Where("name = ?", book.Name).Count(&count).Error != nil || count != 1 {
    		t.Errorf("Count soft deleted record, expects: %v, got: %v", 1, count)
    	}
    
    	var pages uint
    Registered: Wed Jun 12 16:27:09 UTC 2024
    - Last Modified: Wed Feb 01 06:40:55 UTC 2023
    - 5.7K bytes
    - Viewed (0)
  2. tests/multi_primary_keys_test.go

    		Name   string `gorm:"primarykey"`
    		Value  string
    	}
    
    	type Book struct {
    		ID     int
    		Name   string
    		Labels []Label
    	}
    
    	DB.Migrator().DropTable(&Label{}, &Book{})
    	if err := DB.AutoMigrate(&Label{}, &Book{}); err != nil {
    		t.Fatalf("failed to migrate, got %v", err)
    	}
    
    	book := Book{
    		Name: "my book",
    		Labels: []Label{
    			{Name: "region", Value: "emea"},
    		},
    	}
    
    Registered: Wed Jun 12 16:27:09 UTC 2024
    - Last Modified: Thu Jan 06 07:02:53 UTC 2022
    - 12.8K bytes
    - Viewed (0)
  3. schema/relationship_test.go

    }
    
    type Author struct {
    	gorm.Model
    }
    
    type Book struct {
    	gorm.Model
    	Author   Author
    	AuthorID uint
    }
    
    func (Book) TableName() string {
    	return "my_schema.a_very_very_very_very_very_very_very_very_long_table_name"
    }
    
    func TestParseConstraintNameWithSchemaQualifiedLongTableName(t *testing.T) {
    	s, err := schema.Parse(
    		&Book{},
    		&sync.Map{},
    Registered: Wed Jun 12 16:27:09 UTC 2024
    - Last Modified: Mon Apr 15 03:20:20 UTC 2024
    - 25.5K bytes
    - Viewed (0)
  4. src/cmd/compile/internal/ssa/numberlines.go

    	// first built).
    	if i >= len(b.Values)-1 {
    		return i
    	}
    	// Skip the likely-ephemeral/fragile opcodes expected to vanish in a rewrite.
    	if !isPoorStatementOp(v.Op) {
    		return i
    	}
    	// Look ahead to see what the line number is on the next thing that could be a boundary.
    	for j := i + 1; j < len(b.Values); j++ {
    		u := b.Values[j]
    		if u.Pos.IsStmt() == src.PosNotStmt { // ignore non-statements
    			continue
    		}
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Mon Aug 14 21:26:13 UTC 2023
    - 7.8K bytes
    - Viewed (0)
  5. src/cmd/cgo/ast.go

    	// Two different parses: once with comments, once without.
    	// The printer is not good enough at printing comments in the
    	// right place when we start editing the AST behind its back,
    	// so we use ast1 to look for the doc comments on import "C"
    	// and on exported functions, and we use ast2 for translating
    	// and reprinting.
    	// In cgo mode, we ignore ast2 and just apply edits directly
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Wed Jun 07 16:54:27 UTC 2023
    - 14.3K bytes
    - Viewed (0)
  6. src/cmd/compile/internal/ssa/likelyadjust.go

    						}
    					}
    				}
    				if b.Likely != prediction {
    					if b.Likely == BranchUnknown {
    						b.Likely = prediction
    					}
    				}
    			}
    			// Look for calls in the block.  If there is one, make this block unlikely.
    			for _, v := range b.Values {
    				if opcodeTable[v.Op].call {
    					local[b.ID] = blCALL
    					certain[b.ID] = max8(blCALL, certain[b.Succs[0].b.ID])
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Mon Oct 31 21:41:20 UTC 2022
    - 15.4K bytes
    - Viewed (0)
  7. src/cmd/compile/internal/rangefunc/rewrite.go

    	f(func() {
    		defer print("A")
    	})
    
    because the deferred code will run at the end of the iteration, not
    the end of the containing function. To fix that, the runtime provides
    a special hook that lets us obtain a defer "token" representing the
    outer function and then use it in a later defer to attach the deferred
    code to that outer function.
    
    Normally,
    
    	defer print("A")
    
    compiles to
    
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu May 23 01:05:44 UTC 2024
    - 41.6K bytes
    - Viewed (0)
  8. src/cmd/compile/internal/ssa/compile.go

    		f.Logf("compiling %s\n", f.Name)
    	}
    
    	var rnd *rand.Rand
    	if checkEnabled {
    		seed := int64(crc32.ChecksumIEEE(([]byte)(f.Name))) ^ int64(checkRandSeed)
    		rnd = rand.New(rand.NewSource(seed))
    	}
    
    	// hook to print function & phase if panic happens
    	phaseName := "init"
    	defer func() {
    		if phaseName != "" {
    			err := recover()
    			stack := make([]byte, 16384)
    			n := runtime.Stack(stack, false)
    			stack = stack[:n]
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Mon Apr 22 14:55:18 UTC 2024
    - 18.6K bytes
    - Viewed (0)
  9. src/bufio/bufio.go

    // to minimize allocations and copies.
    func (b *Reader) collectFragments(delim byte) (fullBuffers [][]byte, finalFragment []byte, totalLen int, err error) {
    	var frag []byte
    	// Use ReadSlice to look for delim, accumulating full buffers.
    	for {
    		var e error
    		frag, e = b.ReadSlice(delim)
    		if e == nil { // got final fragment
    			break
    		}
    		if e != ErrBufferFull { // unexpected error
    			err = e
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu Oct 12 14:39:08 UTC 2023
    - 21.8K bytes
    - Viewed (0)
  10. src/cmd/cgo/doc.go

    	// #cgo LDFLAGS: -L${SRCDIR}/libs -lfoo
    
    Will be expanded to:
    
    	// #cgo LDFLAGS: -L/go/src/foo/libs -lfoo
    
    When the Go tool sees that one or more Go files use the special import
    "C", it will look for other non-Go files in the directory and compile
    them as part of the Go package. Any .c, .s, .S or .sx files will be
    compiled with the C compiler. Any .cc, .cpp, or .cxx files will be
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Mon May 13 17:12:16 UTC 2024
    - 42.2K bytes
    - Viewed (0)
Back to top