Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 133 for Slice (0.18 sec)

  1. src/builtin/builtin.go

    // it has sufficient capacity, the destination is resliced to accommodate the
    // new elements. If it does not, a new underlying array will be allocated.
    // Append returns the updated slice. It is therefore necessary to store the
    // result of append, often in the variable holding the slice itself:
    //
    //	slice = append(slice, elem1, elem2)
    //	slice = append(slice, anotherSlice...)
    //
    Go
    - Registered: Tue Apr 30 11:13:12 GMT 2024
    - Last Modified: Thu Apr 11 20:22:45 GMT 2024
    - 12.7K bytes
    - Viewed (0)
  2. src/bytes/bytes.go

    // Fields interprets s as a sequence of UTF-8-encoded code points.
    // It splits the slice s around each instance of one or more consecutive white space
    // characters, as defined by unicode.IsSpace, returning a slice of subslices of s or an
    // empty slice if s contains only white space.
    func Fields(s []byte) [][]byte {
    	// First count the fields.
    	// This is an exact count if s is ASCII, otherwise it is an approximation.
    Go
    - Registered: Tue Apr 30 11:13:12 GMT 2024
    - Last Modified: Mon Feb 19 19:51:15 GMT 2024
    - 33.8K bytes
    - Viewed (0)
  3. tests/helper_test.go

    		if len(user.Pets) != len(expect.Pets) {
    			t.Fatalf("pets should equal, expect: %v, got %v", len(expect.Pets), len(user.Pets))
    		}
    
    		sort.Slice(user.Pets, func(i, j int) bool {
    			return user.Pets[i].ID > user.Pets[j].ID
    		})
    
    		sort.Slice(expect.Pets, func(i, j int) bool {
    			return expect.Pets[i].ID > expect.Pets[j].ID
    		})
    
    		for idx, pet := range user.Pets {
    Go
    - Registered: Sun Apr 28 09:35:09 GMT 2024
    - Last Modified: Tue Mar 19 03:50:28 GMT 2024
    - 8K bytes
    - Viewed (0)
  4. tests/create_test.go

    		CheckPet(t, pet2, pet)
    	})
    
    	t.Run("Slice", func(t *testing.T) {
    		pets := []Pet{{
    			Name: "PolymorphicHasOne-Slice-1",
    			Toy:  Toy{Name: "Toy-PolymorphicHasOne-Slice-1"},
    		}, {
    			Name: "PolymorphicHasOne-Slice-2",
    			Toy:  Toy{Name: "Toy-PolymorphicHasOne-Slice-2"},
    		}, {
    			Name: "PolymorphicHasOne-Slice-3",
    			Toy:  Toy{Name: "Toy-PolymorphicHasOne-Slice-3"},
    		}}
    
    Go
    - Registered: Sun Apr 28 09:35:09 GMT 2024
    - Last Modified: Tue Mar 19 03:50:28 GMT 2024
    - 26.4K bytes
    - Viewed (0)
  5. cmd/erasure-metadata-utils.go

    	// Shuffle slice xl metadata for expected distribution.
    	for index := range partsMetadata {
    		blockIndex := distribution[index]
    		shuffledPartsMetadata[blockIndex-1] = partsMetadata[index]
    	}
    	return shuffledPartsMetadata
    }
    
    // shuffleDisks - shuffle input disks slice depending on the
    // erasure distribution. Return shuffled slice of disks with
    // their expected distribution.
    Go
    - Registered: Sun Apr 28 19:28:10 GMT 2024
    - Last Modified: Tue Apr 23 17:15:52 GMT 2024
    - 11.3K bytes
    - Viewed (0)
  6. callbacks/helper_test.go

    		expect clause.Values
    	}{
    		{
    			name: "Test convert slice of string value",
    			input: []map[string]interface{}{
    				{"name": "my name"},
    			},
    			expect: clause.Values{
    				Columns: []clause.Column{{Name: "name"}},
    				Values:  [][]interface{}{{"my name"}},
    			},
    		},
    		{
    			name: "Test convert slice of int value",
    			input: []map[string]interface{}{
    				{"age": 18},
    			},
    Go
    - Registered: Sun Apr 28 09:35:09 GMT 2024
    - Last Modified: Tue Mar 05 02:22:57 GMT 2024
    - 3.4K bytes
    - Viewed (0)
  7. doc/next/6-stdlib/99-minor/slices/65238.md

    The [Repeat] function returns a new slice that repeats the
    Plain Text
    - Registered: Tue Apr 30 11:13:12 GMT 2024
    - Last Modified: Fri Apr 12 20:57:18 GMT 2024
    - 101 bytes
    - Viewed (0)
  8. errors.go

    	// ErrEmptySlice empty slice found
    	ErrEmptySlice = errors.New("empty slice found")
    	// ErrDryRunModeUnsupported dry run mode unsupported
    	ErrDryRunModeUnsupported = errors.New("dry run mode unsupported")
    	// ErrInvalidDB invalid db
    	ErrInvalidDB = errors.New("invalid db")
    	// ErrInvalidValue invalid value
    	ErrInvalidValue = errors.New("invalid value, should be pointer to struct or slice")
    Go
    - Registered: Sun Apr 28 09:35:09 GMT 2024
    - Last Modified: Fri Apr 26 02:53:17 GMT 2024
    - 2.5K bytes
    - Viewed (0)
  9. tests/preload_test.go

    	DB.Preload("Pets.Toy").Find(&user4, "id = ?", user.ID)
    	CheckUser(t, *user4, user)
    }
    
    func TestNestedPreloadForSlice(t *testing.T) {
    	users := []User{
    		*GetUser("slice_nested_preload_1", Config{Pets: 2}),
    		*GetUser("slice_nested_preload_2", Config{Pets: 0}),
    		*GetUser("slice_nested_preload_3", Config{Pets: 3}),
    	}
    
    	for _, user := range users {
    		for idx, pet := range user.Pets {
    Go
    - Registered: Sun Apr 28 09:35:09 GMT 2024
    - Last Modified: Thu Apr 25 12:21:03 GMT 2024
    - 14.9K bytes
    - Viewed (0)
  10. scan.go

    		}
    
    		switch reflectValue.Kind() {
    		case reflect.Slice, reflect.Array:
    			var (
    				elem        reflect.Value
    				isArrayKind = reflectValue.Kind() == reflect.Array
    			)
    
    			if !update || reflectValue.Len() == 0 {
    				update = false
    				if isArrayKind {
    					db.Statement.ReflectValue.Set(reflect.Zero(reflectValue.Type()))
    				} else {
    Go
    - Registered: Sun Apr 28 09:35:09 GMT 2024
    - Last Modified: Fri Apr 26 09:53:11 GMT 2024
    - 9.8K bytes
    - Viewed (0)
Back to top