Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 7 of 7 for UnreadRune (0.17 sec)

  1. src/bytes/reader_test.go

    	}
    }
    
    var UnreadRuneErrorTests = []struct {
    	name string
    	f    func(*Reader)
    }{
    	{"Read", func(r *Reader) { r.Read([]byte{0}) }},
    	{"ReadByte", func(r *Reader) { r.ReadByte() }},
    	{"UnreadRune", func(r *Reader) { r.UnreadRune() }},
    	{"Seek", func(r *Reader) { r.Seek(0, io.SeekCurrent) }},
    	{"WriteTo", func(r *Reader) { r.WriteTo(&Buffer{}) }},
    }
    
    func TestUnreadRuneError(t *testing.T) {
    Registered: Tue Nov 05 11:13:11 UTC 2024
    - Last Modified: Mon Dec 13 18:45:54 UTC 2021
    - 8K bytes
    - Viewed (0)
  2. src/bytes/reader.go

    	r.i += int64(size)
    	return
    }
    
    // UnreadRune complements [Reader.ReadRune] in implementing the [io.RuneScanner] interface.
    func (r *Reader) UnreadRune() error {
    	if r.i <= 0 {
    		return errors.New("bytes.Reader.UnreadRune: at beginning of slice")
    	}
    	if r.prevRune < 0 {
    		return errors.New("bytes.Reader.UnreadRune: previous operation was not ReadRune")
    	}
    	r.i = int64(r.prevRune)
    Registered: Tue Nov 05 11:13:11 UTC 2024
    - Last Modified: Tue Jul 16 18:17:37 UTC 2024
    - 3.9K bytes
    - Viewed (0)
  3. src/bytes/buffer.go

    	return r, n, nil
    }
    
    // UnreadRune unreads the last rune returned by [Buffer.ReadRune].
    // If the most recent read or write operation on the buffer was
    // not a successful [Buffer.ReadRune], UnreadRune returns an error.  (In this regard
    // it is stricter than [Buffer.UnreadByte], which will unread the last byte
    // from any read operation.)
    func (b *Buffer) UnreadRune() error {
    	if b.lastRead <= opInvalid {
    Registered: Tue Nov 05 11:13:11 UTC 2024
    - Last Modified: Tue Oct 29 16:47:05 UTC 2024
    - 15.7K bytes
    - Viewed (0)
  4. src/bufio/bufio_test.go

    		t.Error("unexpected error on ReadRune (1):", err)
    	}
    	if err = r.UnreadRune(); err != nil {
    		t.Error("unexpected error on UnreadRune (1):", err)
    	}
    	if r.UnreadRune() == nil {
    		t.Error("expected error after UnreadRune (1)")
    	}
    	// Test error after Read.
    	_, _, err = r.ReadRune() // reset state
    	if err != nil {
    		t.Error("unexpected error on ReadRune (2):", err)
    	}
    	_, err = r.Read(buf)
    	if err != nil {
    Registered: Tue Nov 05 11:13:11 UTC 2024
    - Last Modified: Fri Nov 01 21:52:12 UTC 2024
    - 51.6K bytes
    - Viewed (0)
  5. src/bytes/buffer_test.go

    		}
    	}
    
    	// Check that UnreadRune works
    	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")
    	}
    
    Registered: Tue Nov 05 11:13:11 UTC 2024
    - Last Modified: Tue Sep 03 20:55:15 UTC 2024
    - 18.6K bytes
    - Viewed (0)
  6. src/bufio/bufio.go

    	b.lastRuneSize = size
    	return r, size, nil
    }
    
    // UnreadRune unreads the last rune. If the most recent method called on
    // the [Reader] was not a [Reader.ReadRune], [Reader.UnreadRune] returns an error. (In this
    // regard it is stricter than [Reader.UnreadByte], which will unread the last byte
    // from any read operation.)
    func (b *Reader) UnreadRune() error {
    	if b.lastRuneSize < 0 || b.r < b.lastRuneSize {
    Registered: Tue Nov 05 11:13:11 UTC 2024
    - Last Modified: Thu Oct 12 14:39:08 UTC 2023
    - 21.8K bytes
    - Viewed (0)
  7. api/go1.txt

    pkg fmt, type ScanState interface { Read, ReadRune, SkipSpace, Token, UnreadRune, Width }
    pkg fmt, type ScanState interface, Read([]uint8) (int, error)
    pkg fmt, type ScanState interface, ReadRune() (int32, int, error)
    pkg fmt, type ScanState interface, SkipSpace()
    pkg fmt, type ScanState interface, Token(bool, func(int32) bool) ([]uint8, error)
    pkg fmt, type ScanState interface, UnreadRune() error
    pkg fmt, type ScanState interface, Width() (int, bool)
    Registered: Tue Nov 05 11:13:11 UTC 2024
    - Last Modified: Wed Aug 14 18:58:28 UTC 2013
    - 1.7M bytes
    - Viewed (0)
Back to top