- Sort Score
- Result 10 results
- Languages All
Results 1 - 10 of 100 for buf4 (0.04 sec)
-
src/bufio/bufio_test.go
} func TestWriterReset(t *testing.T) { var buf1, buf2, buf3, buf4, buf5 strings.Builder w := NewWriter(&buf1) w.WriteString("foo") w.Reset(&buf2) // and not flushed w.WriteString("bar") w.Flush() if buf1.String() != "" { t.Errorf("buf1 = %q; want empty", buf1.String()) } if buf2.String() != "bar" { t.Errorf("buf2 = %q; want bar", buf2.String()) }
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Fri Feb 10 18:56:01 UTC 2023 - 51.5K bytes - Viewed (0) -
test/escape2.go
arr [64]byte arrPtr *[64]byte buf1 []byte buf2 []byte str1 string str2 string } func (b *Buffer) foo() { // ERROR "b does not escape$" b.buf1 = b.buf1[1:2] // ERROR "\(\*Buffer\).foo ignoring self-assignment in b.buf1 = b.buf1\[1:2\]$" b.buf1 = b.buf1[1:2:3] // ERROR "\(\*Buffer\).foo ignoring self-assignment in b.buf1 = b.buf1\[1:2:3\]$"
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Thu Dec 14 17:22:18 UTC 2023 - 35.1K bytes - Viewed (0) -
test/escape2n.go
arr [64]byte arrPtr *[64]byte buf1 []byte buf2 []byte str1 string str2 string } func (b *Buffer) foo() { // ERROR "b does not escape$" b.buf1 = b.buf1[1:2] // ERROR "\(\*Buffer\).foo ignoring self-assignment in b.buf1 = b.buf1\[1:2\]$" b.buf1 = b.buf1[1:2:3] // ERROR "\(\*Buffer\).foo ignoring self-assignment in b.buf1 = b.buf1\[1:2:3\]$"
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Thu Dec 14 17:22:18 UTC 2023 - 35.1K bytes - Viewed (0) -
test/fixedbugs/issue4099.go
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Thu Oct 19 23:33:25 UTC 2023 - 509 bytes - Viewed (0) -
src/compress/lzw/writer_test.go
} func BenchmarkEncoder(b *testing.B) { buf, err := os.ReadFile("../testdata/e.txt") if err != nil { b.Fatal(err) } if len(buf) == 0 { b.Fatalf("test file has no data") } for e := 4; e <= 6; e++ { n := int(math.Pow10(e)) buf0 := buf buf1 := make([]byte, n) for i := 0; i < n; i += len(buf0) { if len(buf0) > n-i { buf0 = buf0[:n-i] } copy(buf1[i:], buf0) }
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Tue Oct 12 11:00:47 UTC 2021 - 5.7K bytes - Viewed (0) -
src/unicode/utf8/example_test.go
} for i, c := range runes { buf := make([]byte, 3) size := utf8.EncodeRune(buf, c) fmt.Printf("%d: %d %[2]s %d\n", i, buf, size) } // Output: // 0: [239 191 189] � 3 // 1: [239 191 189] � 3 // 2: [239 191 189] � 3 } func ExampleFullRune() { buf := []byte{228, 184, 150} // 世 fmt.Println(utf8.FullRune(buf)) fmt.Println(utf8.FullRune(buf[:2])) // Output: // true // false
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Fri Nov 05 21:29:18 UTC 2021 - 3.6K bytes - Viewed (0) -
src/io/example_test.go
// read } func ExampleMultiWriter() { r := strings.NewReader("some io.Reader stream to be read\n") var buf1, buf2 strings.Builder w := io.MultiWriter(&buf1, &buf2) if _, err := io.Copy(w, r); err != nil { log.Fatal(err) } fmt.Print(buf1.String()) fmt.Print(buf2.String()) // Output: // some io.Reader stream to be read // some io.Reader stream to be read }
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Tue Sep 06 15:49:32 UTC 2022 - 5.5K bytes - Viewed (0) -
src/crypto/ecdh/nist.go
panic("crypto/ecdh: internal error: isLess input too large") } bufA, bufB := make([]byte, 72), make([]byte, 72) for i := range a { bufA[i], bufB[i] = a[len(a)-i-1], b[len(b)-i-1] } // Perform a subtraction with borrow. var borrow uint64 for i := 0; i < len(bufA); i += 8 { limbA, limbB := byteorder.LeUint64(bufA[i:]), byteorder.LeUint64(bufB[i:]) _, borrow = bits.Sub64(limbA, limbB, borrow) }
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Mon May 13 18:57:38 UTC 2024 - 8.1K bytes - Viewed (0) -
src/net/http/response_test.go
} fatalf(msg+": %v", err) } var buf bytes.Buffer buf.WriteString("HTTP/1.1 200 OK\r\n") if test.chunked { buf.WriteString("Transfer-Encoding: chunked\r\n") } else { buf.WriteString("Content-Length: 1000000\r\n") } var wr io.Writer = &buf if test.chunked { wr = internal.NewChunkedWriter(wr) } if test.compressed { buf.WriteString("Content-Encoding: gzip\r\n")
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Fri Mar 08 19:01:29 UTC 2024 - 23.6K bytes - Viewed (0) -
src/io/multi_test.go
func() { buf1 := bytes.NewReader([]byte("foo")) buf2 := bytes.NewReader([]byte("bar")) mr = MultiReader(buf1, buf2) runtime.SetFinalizer(buf1, func(*bytes.Reader) { close(closed) }) }() buf := make([]byte, 4) if n, err := ReadFull(mr, buf); err != nil || string(buf) != "foob" { t.Fatalf(`ReadFull = %d (%q), %v; want 3, "foo", nil`, n, buf[:n], err) } runtime.GC()
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Tue Sep 06 15:49:32 UTC 2022 - 10K bytes - Viewed (0)