Search Options

Results per page
Sort
Preferred Languages
Advance

Results 11 - 20 of 349 for readVal (0.26 sec)

  1. src/cmd/internal/buildid/note.go

    	n := sect.Size
    	if n > uint64(readSize) {
    		n = uint64(readSize)
    	}
    	buf := make([]byte, n)
    	if _, err := f.ReadAt(buf, int64(sect.Offset)); err != nil {
    		return "", err
    	}
    
    	return readRaw(name, buf)
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu Aug 17 20:40:42 UTC 2023
    - 6K bytes
    - Viewed (0)
  2. 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)
  3. src/cmd/internal/buildid/buildid.go

    		return readELF(name, f, data)
    	}
    	for _, m := range machoPrefixes {
    		if bytes.HasPrefix(data, m) {
    			return readMacho(name, f, data)
    		}
    	}
    	return readRaw(name, data)
    }
    
    // readRaw finds the raw build ID stored in text segment data.
    func readRaw(name string, data []byte) (id string, err error) {
    	i := bytes.Index(data, goBuildPrefix)
    	if i < 0 {
    		// Missing. Treat as successful but build ID empty.
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Wed Oct 28 21:52:53 UTC 2020
    - 9K bytes
    - Viewed (0)
  4. 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)
  5. 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)
  6. 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)
  7. 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)
  8. src/net/http/httptest/example_test.go

    		io.WriteString(w, "<html><body>Hello World!</body></html>")
    	}
    
    	req := httptest.NewRequest("GET", "http://example.com/foo", nil)
    	w := httptest.NewRecorder()
    	handler(w, req)
    
    	resp := w.Result()
    	body, _ := io.ReadAll(resp.Body)
    
    	fmt.Println(resp.StatusCode)
    	fmt.Println(resp.Header.Get("Content-Type"))
    	fmt.Println(string(body))
    
    	// Output:
    	// 200
    	// text/html; charset=utf-8
    	// <html><body>Hello World!</body></html>
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Tue Oct 20 18:41:18 UTC 2020
    - 2K bytes
    - Viewed (0)
  9. 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)
  10. 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)
Back to top