- Sort Score
- Result 10 results
- Languages All
Results 31 - 40 of 440 for readFull (0.14 sec)
-
src/cmd/go/internal/test/cover.go
buf := make([]byte, len(expect)) r, err := os.Open(file) if err != nil { // Test did not create profile, which is OK. return } defer r.Close() n, err := io.ReadFull(r, buf) if n == 0 { return } if err != nil || string(buf) != expect { fmt.Fprintf(ew, "error: test wrote malformed coverage profile %s.\n", file) return } _, err = io.Copy(coverMerge.f, r)
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Wed Sep 28 11:50:58 UTC 2022 - 2K bytes - Viewed (0) -
cmd/streaming-v4-unsigned.go
return n, cr.err } } if cap(cr.buffer) < size { cr.buffer = make([]byte, size) } else { cr.buffer = cr.buffer[:size] } // Now, we read the payload. _, err = io.ReadFull(cr.reader, cr.buffer) if err == io.EOF && size != 0 { err = io.ErrUnexpectedEOF } if err != nil && err != io.EOF { cr.err = err return n, cr.err }
Registered: Sun Jun 16 00:44:34 UTC 2024 - Last Modified: Sat May 06 02:53:12 UTC 2023 - 6.1K bytes - Viewed (0) -
src/cmd/go/testdata/script/build_output.txt
import ( "bytes" "fmt" "io" "os" ) func main() { f, err := os.Open(os.Args[1]) if err != nil { fmt.Fprintln(os.Stderr, err) os.Exit(1) } buf := make([]byte, 100) io.ReadFull(f, buf) f.Close() if !bytes.HasPrefix(buf, []byte("!<arch>\n")) { fmt.Fprintf(os.Stderr, "file %s exists but is not an archive\n", os.Args[1]) os.Exit(1) }
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Mon Oct 24 21:26:10 UTC 2022 - 1.8K bytes - Viewed (0) -
src/net/http/response_test.go
rbuf := make([]byte, 2500) n, err := io.ReadFull(resp.Body, rbuf) checkErr(err, "2500 byte ReadFull") if n != 2500 { fatalf("ReadFull only read %d bytes", n) } if test.compressed == false && !bytes.Equal(bytes.Repeat([]byte{'x'}, 2500), rbuf) { fatalf("ReadFull didn't read 2500 'x'; got %q", string(rbuf)) } resp.Body.Close() rest, err := io.ReadAll(bufr) checkErr(err, "ReadAll on remainder")
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/index/suffixarray/suffixarray.go
_, err := w.Write(buf[0:binary.MaxVarintLen64]) return err } // readInt reads an int x from r using buf to buffer the read and returns x. func readInt(r io.Reader, buf []byte) (int64, error) { _, err := io.ReadFull(r, buf[0:binary.MaxVarintLen64]) // ok to continue with error x, _ := binary.Varint(buf) return x, err } // writeSlice writes data[:n] to w and returns n. // It uses buf to buffer the write.
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Thu May 23 01:00:11 UTC 2024 - 9.5K bytes - Viewed (0) -
src/cmd/internal/cov/mreader.go
toread := r.fileView[r.off:] if len(toread) < 1 { return 0, io.EOF } if len(toread) < amt { amt = len(toread) } copy(p, toread) r.off += int64(amt) return amt, nil } return io.ReadFull(r.rdr, p) } func (r *MReader) ReadByte() (byte, error) { if r.fileView != nil { toread := r.fileView[r.off:] if len(toread) < 1 { return 0, io.EOF } rv := toread[0] r.off++
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Fri Feb 10 18:12:25 UTC 2023 - 1.8K bytes - Viewed (0) -
src/go/internal/gcimporter/exportdata.go
"bufio" "fmt" "io" "strconv" "strings" ) func readGopackHeader(r *bufio.Reader) (name string, size int, err error) { // See $GOROOT/include/ar.h. hdr := make([]byte, 16+12+6+6+8+10+2) _, err = io.ReadFull(r, hdr) if err != nil { return } // leave for debugging if false { fmt.Printf("header: %s", hdr) } s := strings.TrimSpace(string(hdr[16+12+6+6+8:][:10])) size, err = strconv.Atoi(s)
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Thu May 19 15:49:05 UTC 2022 - 2.4K bytes - Viewed (0) -
src/compress/flate/example_test.go
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Sat Nov 12 18:42:35 UTC 2016 - 6.5K bytes - Viewed (0) -
internal/crypto/key.go
if random == nil { random = rand.Reader } if len(extKey) != 32 { // safety check logger.CriticalIf(context.Background(), errors.New("crypto: invalid key length")) } var nonce [32]byte if _, err := io.ReadFull(random, nonce[:]); err != nil { logger.CriticalIf(context.Background(), errOutOfEntropy) } const Context = "object-encryption-key generation" mac := hmac.New(sha256.New, extKey) mac.Write([]byte(Context))
Registered: Sun Jun 16 00:44:34 UTC 2024 - Last Modified: Tue Mar 19 20:28:10 UTC 2024 - 6.4K bytes - Viewed (0) -
src/io/pipe_test.go
r, w := Pipe() go func() { w.Write([]byte{}) w.Close() }() var b [2]byte ReadFull(r, b[0:2]) r.Close() } func TestWriteNil(t *testing.T) { r, w := Pipe() go func() { w.Write(nil) w.Close() }() var b [2]byte ReadFull(r, b[0:2]) r.Close() } func TestWriteAfterWriterClose(t *testing.T) { r, w := Pipe() defer r.Close()
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Thu May 23 01:00:11 UTC 2024 - 9K bytes - Viewed (0)