Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 6 of 6 for Consumer (0.24 sec)

  1. src/bufio/bufio_test.go

    type eofReader struct {
    	buf []byte
    }
    
    func (r *eofReader) Read(p []byte) (int, error) {
    	read := copy(p, r.buf)
    	r.buf = r.buf[read:]
    
    	switch read {
    	case 0, len(r.buf):
    		// As allowed in the documentation, this will return io.EOF
    		// in the same call that consumes the last of the data.
    		// https://godoc.org/io#Reader
    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)
  2. src/cmd/asm/internal/asm/parse.go

    		if tok == '#' {
    			// A leftover wisp of a #include/#define/etc,
    			// to let us know that p.sawCode should be true now.
    			// Otherwise ignored.
    			continue
    		}
    		return tok
    	}
    }
    
    // line consumes a single assembly line from p.lex of the form
    //
    //	{label:} WORD[.cond] [ arg {, arg} ] (';' | '\n')
    //
    // It adds any labels to p.pendingLabels and returns the word, cond,
    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)
  3. src/bufio/scan.go

    			}
    			if n > 0 {
    				s.empties = 0
    				break
    			}
    			loop++
    			if loop > maxConsecutiveEmptyReads {
    				s.setErr(io.ErrNoProgress)
    				break
    			}
    		}
    	}
    }
    
    // advance consumes n bytes of the buffer. It reports whether the advance was legal.
    func (s *Scanner) advance(n int) bool {
    	if n < 0 {
    		s.setErr(ErrNegativeAdvance)
    		return false
    	}
    	if n > s.end-s.start {
    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)
  4. src/bytes/buffer.go

    }
    
    // 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() {
    		// Buffer is empty, reset to recover space.
    		b.Reset()
    		return 0, 0, io.EOF
    	}
    	c := b.buf[b.off]
    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)
  5. src/archive/tar/reader_test.go

    		}
    		if hdr.Name != v.wantName {
    			t.Errorf("test %d, Header.Name = %s, want %s", i, hdr.Name, v.wantName)
    		}
    		if v.wantErr == nil && r.Len() == 0 {
    			t.Errorf("test %d, canary byte unexpectedly consumed", i)
    		}
    	}
    }
    
    // testNonEmptyReader wraps an io.Reader and ensures that
    // Read is never called with an empty buffer.
    type testNonEmptyReader struct{ io.Reader }
    
    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/bufio/bufio.go

    	b.lastByte = -1
    	b.lastRuneSize = -1
    	return nil
    }
    
    // ReadRune reads a single UTF-8 encoded Unicode character and returns the
    // rune and its size in bytes. If the encoded rune is invalid, it consumes one byte
    // and returns unicode.ReplacementChar (U+FFFD) with a size of 1.
    func (b *Reader) ReadRune() (r rune, size int, err error) {
    Go
    - Registered: Tue Apr 30 11:13:12 GMT 2024
    - Last Modified: Thu Oct 12 14:39:08 GMT 2023
    - 21.8K bytes
    - Viewed (0)
Back to top