- Sort Score
- Result 10 results
- Languages All
Results 1 - 10 of 105 for bufr (0.05 sec)
-
src/net/http/internal/chunked_test.go
r := NewChunkedReader(bufio.NewReaderSize(&b, 16)) buf := make([]byte, len(fillBufChunk)+len(shortChunk)) n, err := r.Read(buf) if n != len(fillBufChunk) || err != nil { t.Errorf("Read = %d, %v; want %d, nil", n, err, len(fillBufChunk)) } buf = buf[:n] if string(buf) != fillBufChunk { t.Errorf("Read = %q; want %q", buf, fillBufChunk) } n, err = r.Read(buf) if n != len(shortChunk) || err != io.EOF {
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Thu Jan 04 20:45:19 UTC 2024 - 8K 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/net/http/server.go
func (c *conn) finalFlush() { if c.bufr != nil { // Steal the bufio.Reader (~4KB worth of memory) and its associated // reader for a future connection. putBufioReader(c.bufr) c.bufr = nil } if c.bufw != nil { c.bufw.Flush() // Steal the bufio.Writer (~4KB worth of memory) and its associated // writer for a future connection. putBufioWriter(c.bufw) c.bufw = nil } }
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Fri Jun 07 17:57:01 UTC 2024 - 123.4K bytes - Viewed (0) -
src/encoding/gob/encoder_test.go
// Encode an int slice. buf := new(bytes.Buffer) slice := []int{1, 1, 1, 1, 1, 1, 1, 1, 1, 1} err := NewEncoder(buf).Encode(slice) if err != nil { t.Fatal("encode:", err) } // Reach into the buffer and smash the count to make the encoded slice very long. buf.Bytes()[buf.Len()-len(slice)-1] = 0xfa // Decode and see error. err = NewDecoder(buf).Decode(&slice) if err == nil {
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Thu May 23 01:00:11 UTC 2024 - 29.7K bytes - Viewed (0) -
src/net/http/fs_test.go
t.Fatal(err) } defer c.Close() _, err = fmt.Fprintf(c, "GET /..\x00 HTTP/1.0\r\n\r\n") if err != nil { t.Fatal(err) } var got bytes.Buffer bufr := bufio.NewReader(io.TeeReader(c, &got)) res, err := ReadResponse(bufr, nil) if err != nil { t.Fatal("ReadResponse: ", err) } if res.StatusCode == 200 { t.Errorf("got status 200; want an error. Body is:\n%s", got.Bytes()) } }
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Wed May 15 23:39:44 UTC 2024 - 49.9K bytes - Viewed (0) -
src/os/exec/exec_test.go
t.Fatal(err) } if _, err := stdin.Write([]byte("O:hi\n")); err != nil { t.Fatal(err) } buf := make([]byte, 5) n, err := io.ReadFull(stdout, buf) if n != len(buf) || err != nil || string(buf) != "O:hi\n" { t.Fatalf("ReadFull = %d, %v, %q", n, err, buf[:n]) } go cancel() if err := c.Wait(); err == nil { t.Fatal("expected Wait failure") } }
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Fri Jun 07 20:13:53 UTC 2024 - 48.4K bytes - Viewed (0) -
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/fixedbugs/issue7690.go
import ( "bytes" "regexp" "runtime" "strconv" ) func main() { buf1 := make([]byte, 1000) buf2 := make([]byte, 1000) runtime.Stack(buf1, false) // CALL is last instruction on this line n := runtime.Stack(buf2, false) // CALL is followed by load of result from stack buf1 = buf1[:bytes.IndexByte(buf1, 0)] buf2 = buf2[:n] re := regexp.MustCompile(`(?m)^main\.main\(\)\n.*/issue7690.go:([0-9]+)`)
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Mon May 02 13:43:18 UTC 2016 - 1.2K 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)