Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 10 for EOF (0.38 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/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)
  3. src/archive/tar/reader.go

    		return nil, nil, err // EOF is okay here; exactly 0 bytes read
    	}
    	if bytes.Equal(tr.blk[:], zeroBlock[:]) {
    		if _, err := io.ReadFull(tr.r, tr.blk[:]); err != nil {
    			return nil, nil, err // EOF is okay here; exactly 1 block of zeros read
    		}
    		if bytes.Equal(tr.blk[:], zeroBlock[:]) {
    			return nil, nil, io.EOF // normal EOF; exactly 2 block of zeros read
    		}
    Go
    - Registered: Tue Apr 30 11:13:12 GMT 2024
    - Last Modified: Fri Mar 08 01:59:14 GMT 2024
    - 26.8K bytes
    - Viewed (0)
  4. src/bytes/bytes.go

    		na++
    		i++
    		// Skip spaces in between fields.
    		for i < len(s) && asciiSpace[s[i]] != 0 {
    			i++
    		}
    		fieldStart = i
    	}
    	if fieldStart < len(s) { // Last field might end at EOF.
    		a[na] = s[fieldStart:len(s):len(s)]
    	}
    	return a
    }
    
    // FieldsFunc interprets s as a sequence of UTF-8-encoded code points.
    // It splits the slice s at each run of code points c satisfying f(c) and
    Go
    - Registered: Tue Apr 30 11:13:12 GMT 2024
    - Last Modified: Mon Feb 19 19:51:15 GMT 2024
    - 33.8K bytes
    - Viewed (0)
  5. doc/go1.17_spec.html

    constant, even if the literal's fractional part is zero.
    </p>
    
    <pre>
    const Pi float64 = 3.14159265358979323846
    const zero = 0.0         // untyped floating-point constant
    const (
    	size int64 = 1024
    	eof        = -1  // untyped integer constant
    )
    const a, b, c = 3, 4, "foo"  // a = 3, b = 4, c = "foo", untyped integer and string constants
    const u, v float32 = 0, 3    // u = 0.0, v = 3.0
    </pre>
    
    <p>
    HTML
    - Registered: Tue May 07 11:14:38 GMT 2024
    - Last Modified: Thu Apr 11 20:22:45 GMT 2024
    - 211.6K bytes
    - Viewed (0)
  6. src/archive/zip/zip_test.go

    	back := ss.size - off
    	if back > int64(ss.keep) {
    		return 0, errDiscardedBytes
    	}
    	suf := ss.Suffix()
    	n = copy(p, suf[len(suf)-int(back):])
    	if n != len(p) {
    		err = io.EOF
    	}
    	return
    }
    
    func (ss *suffixSaver) Suffix() []byte {
    	if len(ss.buf) < ss.keep {
    		return ss.buf
    	}
    	buf := make([]byte, ss.keep)
    	n := copy(buf, ss.buf[ss.start:])
    	copy(buf[n:], ss.buf[:])
    Go
    - Registered: Tue Apr 30 11:13:12 GMT 2024
    - Last Modified: Wed Mar 27 18:23:49 GMT 2024
    - 19.5K bytes
    - Viewed (0)
  7. src/archive/tar/writer_test.go

    	if _, err := tw.Write([]byte("fooo")); err != nil {
    		t.Fatalf("Failed to write the file's data: %s", err)
    	}
    	tw.Close()
    
    	tr := NewReader(&buffer)
    
    	for {
    		header, err := tr.Next()
    		if err == io.EOF {
    			break
    		}
    		if err != nil {
    			t.Fatalf("Failed to read header: %s", err)
    		}
    		if header.Typeflag != TypeReg {
    			t.Fatalf("Typeflag should've been %d, found %d", TypeReg, header.Typeflag)
    		}
    	}
    Go
    - Registered: Tue Apr 30 11:13:12 GMT 2024
    - Last Modified: Tue Feb 27 16:39:23 GMT 2024
    - 38.7K bytes
    - Viewed (0)
  8. src/archive/tar/tar_test.go

    type testFile struct {
    	ops fileOps
    	pos int64
    }
    
    func (f *testFile) Read(b []byte) (int, error) {
    	if len(b) == 0 {
    		return 0, nil
    	}
    	if len(f.ops) == 0 {
    		return 0, io.EOF
    	}
    	s, ok := f.ops[0].(string)
    	if !ok {
    		return 0, errors.New("unexpected Read operation")
    	}
    
    	n := copy(b, s)
    	if len(s) > n {
    		f.ops[0] = s[n:]
    	} else {
    		f.ops = f.ops[1:]
    	}
    Go
    - Registered: Tue Apr 30 11:13:12 GMT 2024
    - Last Modified: Fri Mar 15 16:01:50 GMT 2024
    - 24K bytes
    - Viewed (0)
  9. src/cmd/api/main_test.go

    		for {
    			var pkg struct {
    				ImportPath, Dir string
    				ImportMap       map[string]string
    				Standard        bool
    			}
    			err := dec.Decode(&pkg)
    			if err == io.EOF {
    				break
    			}
    			if err != nil {
    				log.Fatalf("go list: invalid output: %v", err)
    			}
    
    			// - Package "unsafe" contains special signatures requiring
    Go
    - Registered: Tue Apr 30 11:13:12 GMT 2024
    - Last Modified: Tue Apr 09 20:48:51 GMT 2024
    - 31.4K bytes
    - Viewed (0)
  10. doc/go_spec.html

    constant, even if the literal's fractional part is zero.
    </p>
    
    <pre>
    const Pi float64 = 3.14159265358979323846
    const zero = 0.0         // untyped floating-point constant
    const (
    	size int64 = 1024
    	eof        = -1  // untyped integer constant
    )
    const a, b, c = 3, 4, "foo"  // a = 3, b = 4, c = "foo", untyped integer and string constants
    const u, v float32 = 0, 3    // u = 0.0, v = 3.0
    </pre>
    
    <p>
    HTML
    - Registered: Tue May 07 11:14:38 GMT 2024
    - Last Modified: Thu May 02 22:43:51 GMT 2024
    - 279.6K bytes
    - Viewed (0)
Back to top