Search Options

Results per page
Sort
Preferred Languages
Advance

Results 41 - 50 of 349 for readVal (0.11 sec)

  1. src/os/exec/read3.go

    	"io"
    	"os"
    	"os/exec"
    	"os/exec/internal/fdtest"
    	"runtime"
    	"strings"
    )
    
    func main() {
    	fd3 := os.NewFile(3, "fd3")
    	defer fd3.Close()
    
    	bs, err := io.ReadAll(fd3)
    	if err != nil {
    		fmt.Printf("ReadAll from fd 3: %v\n", err)
    		os.Exit(1)
    	}
    
    	// Now verify that there are no other open fds.
    	// stdin == 0
    	// stdout == 1
    	// stderr == 2
    	// descriptor from parent == 3
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Tue Apr 26 14:49:07 UTC 2022
    - 2.2K bytes
    - Viewed (0)
  2. src/strings/reader.go

    		return 0, io.EOF
    	}
    	r.prevRune = -1
    	n = copy(b, r.s[r.i:])
    	r.i += int64(n)
    	return
    }
    
    // ReadAt implements the [io.ReaderAt] interface.
    func (r *Reader) ReadAt(b []byte, off int64) (n int, err error) {
    	// cannot modify state - see io.ReaderAt
    	if off < 0 {
    		return 0, errors.New("strings.Reader.ReadAt: negative offset")
    	}
    	if off >= int64(len(r.s)) {
    		return 0, io.EOF
    	}
    	n = copy(b, r.s[off:])
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Fri Oct 13 17:10:31 UTC 2023
    - 3.9K bytes
    - Viewed (0)
  3. staging/src/k8s.io/apiserver/pkg/util/notfoundhandler/not_found_handler_test.go

    	req := httptest.NewRequest("GET", "http://apiserver.com/apis/flowcontrol.apiserver.k8s.io/v1beta1", nil)
    	rw := httptest.NewRecorder()
    
    	target.ServeHTTP(rw, req)
    	resp := rw.Result()
    	body, err := io.ReadAll(resp.Body)
    	if err != nil {
    		t.Fatal(err)
    	}
    	bodyStr := strings.TrimSuffix(string(body), "\n")
    
    	if resp.StatusCode != 404 {
    		t.Fatalf("unexpected status code %d, expected 503", resp.StatusCode)
    	}
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Tue Oct 19 11:26:59 UTC 2021
    - 2.5K bytes
    - Viewed (0)
  4. src/cmd/vendor/golang.org/x/telemetry/internal/mmap/mmap_other.go

    package mmap
    
    import (
    	"io"
    	"os"
    )
    
    // mmapFile on other systems doesn't mmap the file. It just reads everything.
    func mmapFile(f *os.File, _ *Data) (Data, error) {
    	b, err := io.ReadAll(f)
    	if err != nil {
    		return Data{}, err
    	}
    	return Data{f, b, nil}, nil
    }
    
    func munmapFile(d Data) error {
    	return nil
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Tue Jan 30 21:40:49 UTC 2024
    - 540 bytes
    - Viewed (0)
  5. src/encoding/csv/fuzz_test.go

    			r := NewReader(bytes.NewReader(in))
    			r.Comma = tt.Comma
    			r.Comment = tt.Comment
    			r.LazyQuotes = tt.LazyQuotes
    			r.TrimLeadingSpace = tt.TrimLeadingSpace
    
    			records, err := r.ReadAll()
    			if err != nil {
    				continue
    			}
    			t.Logf("first records = %#v", records)
    
    			buf.Reset()
    			w := NewWriter(buf)
    			w.Comma = tt.Comma
    			err = w.WriteAll(records)
    			if err != nil {
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Fri Apr 05 01:26:13 UTC 2024
    - 2.5K bytes
    - Viewed (0)
  6. src/net/http/httptest/server_test.go

    	res, err := http.Get(ts.URL)
    	if err != nil {
    		t.Fatal(err)
    	}
    	got, err := io.ReadAll(res.Body)
    	res.Body.Close()
    	if err != nil {
    		t.Fatal(err)
    	}
    	if string(got) != "hello" {
    		t.Fatalf("got %q, want hello", string(got))
    	}
    
    	ts.Close()
    
    	res, err = http.Get(ts.URL)
    	if err == nil {
    		body, _ := io.ReadAll(res.Body)
    		t.Fatalf("Unexpected response after close: %v, %v, %s", res.Status, res.Header, body)
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Mon Mar 18 16:57:12 UTC 2024
    - 7.4K bytes
    - Viewed (0)
  7. src/cmd/go/internal/mmap/mmap_other.go

    //go:build (js && wasm) || wasip1 || plan9
    
    package mmap
    
    import (
    	"io"
    	"os"
    )
    
    // mmapFile on other systems doesn't mmap the file. It just reads everything.
    func mmapFile(f *os.File) (Data, error) {
    	b, err := io.ReadAll(f)
    	if err != nil {
    		return Data{}, err
    	}
    	return Data{f, b}, nil
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Fri Dec 15 21:57:36 UTC 2023
    - 454 bytes
    - Viewed (0)
  8. pkg/wasm/httpfetcher.go

    			}
    			time.Sleep(b.NextBackOff())
    			continue
    		}
    		if resp.StatusCode == http.StatusOK {
    			// Limit wasm module to 256mb; in reality it must be much smaller
    			body, err := io.ReadAll(io.LimitReader(resp.Body, 1024*1024*256))
    			if err != nil {
    				return nil, err
    			}
    			err = resp.Body.Close()
    			if err != nil {
    				wasmLog.Infof("wasm server connection is not closed: %v", err)
    			}
    Registered: Fri Jun 14 15:00:06 UTC 2024
    - Last Modified: Mon Nov 14 20:23:34 UTC 2022
    - 5.5K bytes
    - Viewed (0)
  9. src/net/http/alpn_test.go

    	}
    	ts.StartTLS()
    	defer ts.Close()
    
    	// Normal request, without NPN.
    	{
    		c := ts.Client()
    		res, err := c.Get(ts.URL)
    		if err != nil {
    			t.Fatal(err)
    		}
    		body, err := io.ReadAll(res.Body)
    		if err != nil {
    			t.Fatal(err)
    		}
    		if want := "path=/,proto="; string(body) != want {
    			t.Errorf("plain request = %q; want %q", body, want)
    		}
    	}
    
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Tue Oct 20 18:41:18 UTC 2020
    - 3K bytes
    - Viewed (0)
  10. src/mime/example_test.go

    		switch charset {
    		case "x-case":
    			// Fake character set for example.
    			// Real use would integrate with packages such
    			// as code.google.com/p/go-charset
    			content, err := io.ReadAll(input)
    			if err != nil {
    				return nil, err
    			}
    			return bytes.NewReader(bytes.ToUpper(content)), nil
    		default:
    			return nil, fmt.Errorf("unhandled charset %q", charset)
    		}
    	}
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Tue Oct 20 18:41:18 UTC 2020
    - 2.9K bytes
    - Viewed (0)
Back to top