- Sort Score
- Result 10 results
- Languages All
Results 1 - 10 of 13 for Slice (0.14 sec)
-
doc/go1.17_spec.html
a slice of length up to that capacity can be created by <a href="#Slice_expressions"><i>slicing</i></a> a new one from the original slice. The capacity of a slice <code>a</code> can be discovered using the built-in function <a href="#Length_and_capacity"><code>cap(a)</code></a>. </p> <p> A new, initialized slice value for a given element type <code>T</code> is
HTML - Registered: Tue May 07 11:14:38 GMT 2024 - Last Modified: Thu Apr 11 20:22:45 GMT 2024 - 211.6K bytes - Viewed (0) -
src/bytes/buffer_test.go
}() buf := NewBuffer(make([]byte, 1)) const maxInt = int(^uint(0) >> 1) buf.Grow(maxInt) } // Was a bug: used to give EOF reading empty slice at EOF. func TestReadEmptyAtEOF(t *testing.T) { b := new(Buffer) slice := make([]byte, 0) n, err := b.Read(slice) if err != nil { t.Errorf("read error: %v", err) } if n != 0 { t.Errorf("wrong count; got %d want 0", n) } }
Go - Registered: Tue Apr 30 11:13:12 GMT 2024 - Last Modified: Fri Apr 26 13:31:36 GMT 2024 - 18.6K bytes - Viewed (0) -
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) -
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) -
src/cmd/cgo/doc.go
passing a pointer to a field in a struct, the Go memory in question is the memory occupied by the field, not the entire struct. When passing a pointer to an element in an array or slice, the Go memory in question is the entire array or the entire backing array of the slice. C code may keep a copy of a Go pointer only as long as the memory it points to is pinned. C code may not keep a copy of a Go pointer after the call returns,
Go - Registered: Tue Apr 30 11:13:12 GMT 2024 - Last Modified: Sun Mar 31 09:02:45 GMT 2024 - 42.1K bytes - Viewed (0) -
doc/next/6-stdlib/99-minor/slices/65238.md
The [Repeat] function returns a new slice that repeats the
Plain Text - Registered: Tue May 07 11:14:38 GMT 2024 - Last Modified: Fri Apr 12 20:57:18 GMT 2024 - 101 bytes - Viewed (0) -
doc/go_spec.html
The <i>capacity</i> is a measure of that extent: it is the sum of the length of the slice and the length of the array beyond the slice; a slice of length up to that capacity can be created by <a href="#Slice_expressions"><i>slicing</i></a> a new one from the original slice. The capacity of a slice <code>a</code> can be discovered using the built-in function <a href="#Length_and_capacity"><code>cap(a)</code></a>.
HTML - Registered: Tue May 07 11:14:38 GMT 2024 - Last Modified: Thu May 02 22:43:51 GMT 2024 - 279.6K bytes - Viewed (0) -
doc/next/6-stdlib/99-minor/reflect/61308.md
The [SliceAt(typ Type, p unsafe.Pointer, len int)] function returns a Value representing a slice whose underlying array starts
Plain Text - Registered: Tue May 07 11:14:38 GMT 2024 - Last Modified: Fri Apr 12 20:57:18 GMT 2024 - 170 bytes - Viewed (0) -
src/bytes/bytes_test.go
} if string(b) != tt.s { t.Errorf("slice changed to %s; want %s", b, tt.s) } if len(tt.a) > 0 { if want := tt.a[len(tt.a)-1] + "z"; string(x) != want { t.Errorf("last appended result was %s; want %s", x, want) } } } } // Test case for any function which accepts and returns a byte slice. // For ease of creation, we write the input byte slice as a string. type StringTest struct {
Go - Registered: Tue Apr 30 11:13:12 GMT 2024 - Last Modified: Wed Jan 24 16:07:25 GMT 2024 - 56.2K bytes - Viewed (0) -
src/archive/zip/reader_test.go
} } func TestCVE202133196(t *testing.T) { // Archive that indicates it has 1 << 128 -1 files, // this would previously cause a panic due to attempting // to allocate a slice with 1 << 128 -1 elements. data := []byte{ 0x50, 0x4b, 0x03, 0x04, 0x14, 0x00, 0x08, 0x08, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
Go - Registered: Tue Apr 30 11:13:12 GMT 2024 - Last Modified: Wed Mar 27 18:23:49 GMT 2024 - 55.3K bytes - Viewed (0)