Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 2 of 2 for ReadRune (0.06 sec)

  1. src/bufio/bufio_test.go

    	}
    }
    
    func TestUnreadRuneAtEOF(t *testing.T) {
    	// UnreadRune/ReadRune should error at EOF (was a bug; used to panic)
    	r := NewReader(strings.NewReader("x"))
    	r.ReadRune()
    	r.ReadRune()
    	r.UnreadRune()
    	_, _, err := r.ReadRune()
    	if err == nil {
    		t.Error("expected error at EOF")
    	} else if err != io.EOF {
    		t.Error("expected EOF; got", err)
    	}
    }
    
    Registered: Tue Nov 05 11:13:11 UTC 2024
    - Last Modified: Fri Nov 01 21:52:12 UTC 2024
    - 51.6K bytes
    - Viewed (0)
  2. src/bytes/buffer.go

    	c := b.buf[b.off]
    	b.off++
    	b.lastRead = opRead
    	return c, nil
    }
    
    // ReadRune reads and returns the next UTF-8-encoded
    // Unicode code point from the buffer.
    // If no bytes are available, the error returned is io.EOF.
    // If the bytes are an erroneous UTF-8 encoding, it
    // consumes one byte and returns U+FFFD, 1.
    func (b *Buffer) ReadRune() (r rune, size int, err error) {
    	if b.empty() {
    Registered: Tue Nov 05 11:13:11 UTC 2024
    - Last Modified: Tue Oct 29 16:47:05 UTC 2024
    - 15.7K bytes
    - Viewed (0)
Back to top