Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 39 for EOF (2.69 sec)

  1. src/bytes/buffer_test.go

    	buf.Reset()
    
    	// check at EOF
    	if err := buf.UnreadRune(); err == nil {
    		t.Fatal("UnreadRune at EOF: got no error")
    	}
    	if _, _, err := buf.ReadRune(); err == nil {
    		t.Fatal("ReadRune at EOF: got no error")
    	}
    	if err := buf.UnreadRune(); err == nil {
    		t.Fatal("UnreadRune after ReadRune at EOF: got no error")
    	}
    
    	// check not at EOF
    	buf.Write(b)
    	for r := rune(0); r < NRune; r++ {
    Go
    - Registered: Tue Apr 30 11:13:12 GMT 2024
    - Last Modified: Fri Apr 26 13:31:36 GMT 2024
    - 18.6K bytes
    - Viewed (0)
  2. src/bufio/bufio_test.go

    		t.Errorf(`Peek(4) on "abcd", EOF = %q, %v; want "abcd", nil`, string(s), err)
    	}
    	if n, err := buf.Read(p[0:5]); string(p[0:n]) != "abcd" || err != nil {
    		t.Fatalf("Read after peek = %q, %v; want abcd, EOF", p[0:n], err)
    	}
    	if n, err := buf.Read(p[0:1]); string(p[0:n]) != "" || err != io.EOF {
    		t.Fatalf(`second Read after peek = %q, %v; want "", EOF`, p[0:n], err)
    	}
    }
    
    type dataAndEOFReader string
    
    Go
    - Registered: Tue Apr 30 11:13:12 GMT 2024
    - Last Modified: Fri Feb 10 18:56:01 GMT 2023
    - 51.5K bytes
    - Viewed (0)
  3. src/bufio/export_test.go

    	if n < utf8.UTFMax || n > 1e9 {
    		panic("bad max token size")
    	}
    	if n < len(s.buf) {
    		s.buf = make([]byte, n)
    	}
    	s.maxTokenSize = n
    }
    
    // ErrOrEOF is like Err, but returns EOF. Used to test a corner case.
    func (s *Scanner) ErrOrEOF() error {
    	return s.err
    Go
    - Registered: Tue Apr 30 11:13:12 GMT 2024
    - Last Modified: Thu Nov 02 17:17:44 GMT 2017
    - 597 bytes
    - Viewed (0)
  4. src/cmd/asm/internal/asm/expr_test.go

    		}
    		tok := p.next()
    		if test.atEOF && tok.ScanToken != scanner.EOF {
    			t.Errorf("%d: %q: at EOF got %s", i, test.input, tok)
    		} else if !test.atEOF && tok.ScanToken == scanner.EOF {
    			t.Errorf("%d: %q: expected not EOF but at EOF", i, test.input)
    		}
    	}
    }
    
    type badExprTest struct {
    	input string
    	error string // Empty means no error.
    }
    
    Go
    - Registered: Tue Apr 30 11:13:12 GMT 2024
    - Last Modified: Tue Aug 29 07:48:38 GMT 2023
    - 3.2K bytes
    - Viewed (0)
  5. src/archive/tar/reader_test.go

    		{data2[:2048] + trash, 1, ErrHeader},
    		{data2[:2560], 1, io.EOF}, // Exactly 2 empty blocks (normal end-of-stream)
    		{data2[:2560] + trash[:1], 1, io.EOF},
    		{data2[:2560] + trash[:511], 1, io.EOF},
    		{data2[:2560] + trash, 1, io.EOF},
    		{data2[:3072], 1, io.EOF},
    		{pax, 0, io.EOF}, // PAX header without data is a "valid" tar file
    		{pax + trash[:1], 0, io.ErrUnexpectedEOF},
    Go
    - Registered: Tue Apr 30 11:13:12 GMT 2024
    - Last Modified: Mon Nov 21 21:14:38 GMT 2022
    - 47.1K bytes
    - Viewed (0)
  6. src/bytes/buffer.go

    // what is required to hold the contents of r, ReadFrom will not grow the
    // underlying buffer.
    const MinRead = 512
    
    // ReadFrom reads data from r until EOF and appends it to the buffer, growing
    // the buffer as needed. The return value n is the number of bytes read. Any
    // error except io.EOF encountered during the read is also returned. If the
    // buffer becomes too large, ReadFrom will panic with [ErrTooLarge].
    Go
    - Registered: Tue Apr 30 11:13:12 GMT 2024
    - Last Modified: Fri Oct 13 17:10:31 GMT 2023
    - 15.7K bytes
    - Viewed (0)
  7. src/bufio/scan.go

    	return &Scanner{
    		r:            r,
    		split:        ScanLines,
    		maxTokenSize: MaxScanTokenSize,
    	}
    }
    
    // Err returns the first non-EOF error that was encountered by the [Scanner].
    func (s *Scanner) Err() error {
    	if s.err == io.EOF {
    		return nil
    	}
    	return s.err
    }
    
    // Bytes returns the most recent token generated by a call to [Scanner.Scan].
    Go
    - Registered: Tue Apr 30 11:13:12 GMT 2024
    - Last Modified: Mon Oct 23 09:06:30 GMT 2023
    - 14.2K bytes
    - Viewed (0)
  8. src/bytes/reader_test.go

    	}
    
    	if n, err := (&Reader{}).Read(nil); n != 0 || err != io.EOF {
    		t.Errorf("Read: got %d, %v; want 0, io.EOF", n, err)
    	}
    
    	if n, err := (&Reader{}).ReadAt(nil, 11); n != 0 || err != io.EOF {
    		t.Errorf("ReadAt: got %d, %v; want 0, io.EOF", n, err)
    	}
    
    	if b, err := (&Reader{}).ReadByte(); b != 0 || err != io.EOF {
    		t.Errorf("ReadByte: got %d, %v; want 0, io.EOF", b, err)
    	}
    
    Go
    - Registered: Tue Apr 30 11:13:12 GMT 2024
    - Last Modified: Mon Dec 13 18:45:54 GMT 2021
    - 8K bytes
    - Viewed (0)
  9. src/bytes/reader.go

    	}
    	if off >= int64(len(r.s)) {
    		return 0, io.EOF
    	}
    	n = copy(b, r.s[off:])
    	if n < len(b) {
    		err = io.EOF
    	}
    	return
    }
    
    // ReadByte implements the [io.ByteReader] interface.
    func (r *Reader) ReadByte() (byte, error) {
    	r.prevRune = -1
    	if r.i >= int64(len(r.s)) {
    		return 0, io.EOF
    	}
    	b := r.s[r.i]
    	r.i++
    	return b, nil
    }
    
    Go
    - Registered: Tue Apr 30 11:13:12 GMT 2024
    - Last Modified: Fri Oct 13 17:10:31 GMT 2023
    - 3.9K bytes
    - Viewed (0)
  10. src/cmd/asm/internal/asm/parse.go

    	value, err := strconv.ParseFloat(str, 64)
    	if err != nil {
    		p.errorf("%s", err)
    	}
    	return value
    }
    
    // EOF represents the end of input.
    var EOF = lex.Make(scanner.EOF, "EOF")
    
    func (p *Parser) next() lex.Token {
    	if !p.more() {
    		return EOF
    	}
    	tok := p.input[p.inputPos]
    	p.inputPos++
    	return tok
    }
    
    func (p *Parser) back() {
    	if p.inputPos == 0 {
    Go
    - Registered: Tue Apr 30 11:13:12 GMT 2024
    - Last Modified: Wed Feb 21 14:34:57 GMT 2024
    - 36.9K bytes
    - Viewed (0)
Back to top