Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 2 of 2 for error (0.15 sec)

  1. src/bytes/buffer_test.go

    	if err != nil {
    		t.Errorf("read error: %v", err)
    	}
    	if n != 0 {
    		t.Errorf("wrong count; got %d want 0", n)
    	}
    }
    
    func TestUnreadByte(t *testing.T) {
    	b := new(Buffer)
    
    	// check at EOF
    	if err := b.UnreadByte(); err == nil {
    		t.Fatal("UnreadByte at EOF: got no error")
    	}
    	if _, err := b.ReadByte(); err == nil {
    		t.Fatal("ReadByte at EOF: got no error")
    	}
    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. doc/go_spec.html

    </p>
    
    <h2 id="Errors">Errors</h2>
    
    <p>
    The predeclared type <code>error</code> is defined as
    </p>
    
    <pre>
    type error interface {
    	Error() string
    }
    </pre>
    
    <p>
    It is the conventional interface for representing an error condition,
    with the nil value representing no error.
    For instance, a function to read data from a file might be defined:
    HTML
    - Registered: Tue Apr 30 11:13:12 GMT 2024
    - Last Modified: Fri Apr 26 00:39:16 GMT 2024
    - 279.6K bytes
    - Viewed (0)
Back to top