Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 19 for SliceMap (0.26 sec)

  1. src/runtime/runtime-gdb_test.go

    	slicemap := make(map[string][]string,` + strconv.FormatInt(abi.MapBucketCount+3, 10) + `)
        chanint := make(chan int, 10)
        chanstr := make(chan string, 10)
        chanint <- 99
    	chanint <- 11
        chanstr <- "spongepants"
        chanstr <- "squarebob"
    	mapvar["abc"] = "def"
    	mapvar["ghi"] = "jkl"
    	slicemap["a"] = []string{"b","c","d"}
        slicemap["e"] = []string{"f","g","h"}
    	strvar := "abc"
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Wed Feb 21 22:16:54 UTC 2024
    - 23.2K bytes
    - Viewed (0)
  2. src/testing/quick/quick_test.go

    // Issues 8818 and 11148.
    func TestRecursive(t *testing.T) {
    	type R struct {
    		Ptr      *R
    		SliceP   []*R
    		Slice    []R
    		Map      map[int]R
    		MapP     map[int]*R
    		MapR     map[*R]*R
    		SliceMap []map[int]R
    	}
    
    	f := func(r R) bool { return true }
    	Check(f, nil)
    }
    
    func TestEmptyStruct(t *testing.T) {
    	f := func(struct{}) bool { return true }
    	Check(f, nil)
    }
    
    type (
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Wed May 22 12:54:00 UTC 2019
    - 9K bytes
    - Viewed (0)
  3. tests/create_test.go

    	data := []User{}
    	if err := DB.Create(&data).Error; err != gorm.ErrEmptySlice {
    		t.Errorf("no data should be created, got %v", err)
    	}
    
    	sliceMap := []map[string]interface{}{}
    	if err := DB.Model(&User{}).Create(&sliceMap).Error; err != gorm.ErrEmptySlice {
    		t.Errorf("no data should be created, got %v", err)
    	}
    }
    
    func TestCreateInvalidSlice(t *testing.T) {
    	users := []*User{
    Registered: Wed Jun 12 16:27:09 UTC 2024
    - Last Modified: Tue Mar 19 03:50:28 UTC 2024
    - 26.4K bytes
    - Viewed (0)
  4. test/slicecap.go

    Emmanuel Odeke <******@****.***> 1460323946 -0700
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Mon May 02 13:43:18 UTC 2016
    - 1.9K bytes
    - Viewed (0)
  5. src/internal/saferio/io_test.go

    	t.Run("maxint", func(t *testing.T) {
    		c := SliceCap[byte](1 << 63)
    		if c >= 0 {
    			t.Errorf("SliceCap returned %d, expected failure", c)
    		}
    	})
    
    	t.Run("overflow", func(t *testing.T) {
    		c := SliceCap[int64](1 << 62)
    		if c >= 0 {
    			t.Errorf("SliceCap returned %d, expected failure", c)
    		}
    	})
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu Aug 31 00:34:05 UTC 2023
    - 3.1K bytes
    - Viewed (0)
  6. src/internal/saferio/io.go

    	}
    	if size > 0 && c > (1<<64-1)/size {
    		return -1
    	}
    	if c*size > chunk {
    		c = chunk / size
    		if c == 0 {
    			c = 1
    		}
    	}
    	return int(c)
    }
    
    // SliceCap is like SliceCapWithSize but using generics.
    func SliceCap[E any](c uint64) int {
    	var v E
    	size := uint64(unsafe.Sizeof(v))
    	return SliceCapWithSize(size, c)
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu Aug 31 00:34:05 UTC 2023
    - 3.4K bytes
    - Viewed (0)
  7. src/cmd/compile/internal/ssa/_gen/dec.rules

      (Store {typ.Int}
        (OffPtr <typ.IntPtr> [config.PtrSize] dst)
        len
        (Store {typ.BytePtr} dst ptr mem))
    
    // slice ops
    (SlicePtr (SliceMake ptr _ _ )) => ptr
    (SliceLen (SliceMake _ len _)) => len
    (SliceCap (SliceMake _ _ cap)) => cap
    (SlicePtrUnchecked (SliceMake ptr _ _ )) => ptr
    
    (Load <t> ptr mem) && t.IsSlice() =>
      (SliceMake
        (Load <t.Elem().PtrTo()> ptr mem)
        (Load <typ.Int>
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu Oct 12 00:48:31 UTC 2023
    - 6.9K bytes
    - Viewed (0)
  8. test/indirect.go

    		panic("fail")
    	}
    
    	x =
    		len(b0) +
    			len(b3)
    	if x != 3 {
    		println("wrong slicelen")
    		panic("fail")
    	}
    
    	x =
    		cap(b0) +
    			cap(b3)
    	if x != 3 {
    		println("wrong slicecap")
    		panic("fail")
    	}
    }
    
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu Feb 23 07:47:26 UTC 2012
    - 1.4K bytes
    - Viewed (0)
  9. src/debug/macho/fat.go

    	// Make sure that all images are for the same MH_ type.
    	var machoType Type
    
    	// Following the fat_header comes narch fat_arch structs that index
    	// Mach-O images further in the file.
    	c := saferio.SliceCap[FatArch](uint64(narch))
    	if c < 0 {
    		return nil, &FormatError{offset, "too many images", nil}
    	}
    	ff.Arches = make([]FatArch, 0, c)
    	for i := uint32(0); i < narch; i++ {
    		var fa FatArch
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Wed Oct 18 19:33:30 UTC 2023
    - 4.1K bytes
    - Viewed (0)
  10. src/debug/pe/symbol.go

    	if fh.NumberOfSymbols <= 0 {
    		return nil, nil
    	}
    	_, err := r.Seek(int64(fh.PointerToSymbolTable), io.SeekStart)
    	if err != nil {
    		return nil, fmt.Errorf("fail to seek to symbol table: %v", err)
    	}
    	c := saferio.SliceCap[COFFSymbol](uint64(fh.NumberOfSymbols))
    	if c < 0 {
    		return nil, errors.New("too many symbols; file may be corrupt")
    	}
    	syms := make([]COFFSymbol, 0, c)
    	naux := 0
    	for k := uint32(0); k < fh.NumberOfSymbols; k++ {
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Wed Oct 18 19:33:30 UTC 2023
    - 6.6K bytes
    - Viewed (0)
Back to top