- Sort Score
- Result 10 results
- Languages All
Results 11 - 20 of 297 for readVal (0.21 sec)
-
pkg/credentialprovider/config.go
} // Error implements error func (he *HTTPError) Error() string { return fmt.Sprintf("http status code: %d while fetching url %s", he.StatusCode, he.URL) } // ReadURL read contents from given url func ReadURL(url string, client *http.Client, header *http.Header) (body []byte, err error) { req, err := http.NewRequest("GET", url, nil) if err != nil { return nil, err } if header != nil {
Registered: Sat Jun 15 01:39:40 UTC 2024 - Last Modified: Wed Apr 19 15:11:57 UTC 2023 - 9.3K bytes - Viewed (0) -
cmd/storage-interface.go
// Write all data, syncs the data to disk. // Should be used for smaller payloads. WriteAll(ctx context.Context, volume string, path string, b []byte) (err error) // Read all. ReadAll(ctx context.Context, volume string, path string) (buf []byte, err error) GetDiskLoc() (poolIdx, setIdx, diskIdx int) // Retrieve location indexes.
Registered: Sun Jun 16 00:44:34 UTC 2024 - Last Modified: Mon Jun 10 15:51:27 UTC 2024 - 5K bytes - Viewed (0) -
cmd/dummy-data-generator_test.go
} func TestDummyDataGenerator(t *testing.T) { readAll := func(r io.Reader) string { b, _ := io.ReadAll(r) return string(b) } checkEq := func(a, b string) { if a != b { t.Fatalf("Unexpected equality failure") } } checkEq(readAll(NewDummyDataGen(0, 0)), "") checkEq(readAll(NewDummyDataGen(10, 0)), readAll(NewDummyDataGen(10, int64(len(alphabets)))))
Registered: Sun Jun 16 00:44:34 UTC 2024 - Last Modified: Mon Sep 19 18:05:16 UTC 2022 - 4.8K bytes - Viewed (0) -
src/runtime/testdata/testfds/main.go
if err != nil { log.Fatalf("os.Open failed: %s", err) } defer f.Close() b, err := io.ReadAll(os.Stdin) if err != nil { log.Fatalf("io.ReadAll(os.Stdin) failed: %s", err) } if len(b) != 0 { log.Fatalf("io.ReadAll(os.Stdin) returned non-nil: %x", b) } fmt.Fprintf(os.Stdout, "stdout\n") fmt.Fprintf(os.Stderr, "stderr\n")
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Tue Jul 25 16:33:33 UTC 2023 - 642 bytes - Viewed (0) -
src/crypto/rand/rand.go
} // batched returns a function that calls f to populate a []byte by chunking it // into subslices of, at most, readMax bytes. func batched(f func([]byte) error, readMax int) func([]byte) error { return func(out []byte) error { for len(out) > 0 { read := len(out) if read > readMax { read = readMax } if err := f(out[:read]); err != nil { return err } out = out[read:] } return nil }
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Tue Mar 19 20:02:21 UTC 2024 - 1.5K bytes - Viewed (0) -
src/testing/fstest/testfs.go
// Read entire file. f, err := t.fsys.Open(file) if err != nil { t.errorf("%s: Open: %w", file, err) return } data, err := io.ReadAll(f) if err != nil { f.Close() t.errorf("%s: Open+ReadAll: %w", file, err) return } if err := f.Close(); err != nil { t.errorf("%s: Close: %w", file, err) } // Check that closing twice doesn't crash.
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Thu May 23 01:00:11 UTC 2024 - 16.3K bytes - Viewed (0) -
src/embed/internal/embedtest/embed_test.go
t.Fatal("Seek:", off) } // Use ReadAt to read the entire file, ignoring the offset. at := file.(io.ReaderAt) got = make([]byte, len(want)) n, err = at.ReadAt(got, 0) if err != nil { t.Fatal("ReadAt:", err) } if n != len(want) { t.Fatalf("ReadAt: got %d bytes, want %d bytes", n, len(want)) } if string(got) != want { t.Fatalf("ReadAt: got %q, want %q", got, want) }
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Fri Apr 14 20:10:16 UTC 2023 - 5.4K bytes - Viewed (0) -
src/net/http/internal/chunked_test.go
t.Fatalf("chunk writer wrote %q; want %q", g, e) } r := NewChunkedReader(&b) data, err := io.ReadAll(r) if err != nil { t.Logf(`data: "%s"`, data) t.Fatalf("ReadAll from reader: %v", err) } if g, e := string(data), chunk1+chunk2; g != e { t.Errorf("chunk reader read %q; want %q", g, e) } } func TestChunkReadMultiple(t *testing.T) {
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Thu Jan 04 20:45:19 UTC 2024 - 8K bytes - Viewed (0) -
src/compress/gzip/gzip_test.go
t.Fatalf("NewReader: %v", err) } if want := (Header{OS: 255}); !reflect.DeepEqual(r.Header, want) { t.Errorf("Header mismatch:\ngot %#v\nwant %#v", r.Header, want) } b, err := io.ReadAll(r) if err != nil { t.Fatalf("ReadAll: %v", err) } if len(b) != 0 { t.Fatalf("got %d bytes, want 0", len(b)) } if err := r.Close(); err != nil { t.Fatalf("Reader.Close: %v", err) } }
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Mon Mar 11 17:10:06 UTC 2024 - 6K bytes - Viewed (0) -
src/net/http/filetransport_test.go
t.Errorf("for %s, ContentLength = %d, want -1", urlstr, res.ContentLength) } if res.Body == nil { t.Fatalf("for %s, nil Body", urlstr) } slurp, err := io.ReadAll(res.Body) res.Body.Close() check("ReadAll "+urlstr, err) if string(slurp) != "Bar" { t.Errorf("for %s, got content %q, want %q", urlstr, string(slurp), "Bar") } } const badURL = "file://../no-exist.txt"
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Mon Aug 07 17:07:12 UTC 2023 - 2.6K bytes - Viewed (0)