Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 5 of 5 for HasWritten (0.22 sec)

  1. internal/ioutil/ioutil_test.go

    	writer := WriteOnClose(io.Discard)
    	if writer.HasWritten() {
    		t.Error("WriteOnCloser must not be marked as HasWritten")
    	}
    	writer.Write(nil)
    	if !writer.HasWritten() {
    		t.Error("WriteOnCloser must be marked as HasWritten")
    	}
    
    	writer = WriteOnClose(io.Discard)
    	writer.Close()
    	if !writer.HasWritten() {
    		t.Error("WriteOnCloser must be marked as HasWritten")
    	}
    }
    
    // Test for AppendFile.
    Go
    - Registered: Sun Apr 21 19:28:08 GMT 2024
    - Last Modified: Fri Feb 02 11:02:31 GMT 2024
    - 5.1K bytes
    - Viewed (0)
  2. internal/ioutil/ioutil.go

    // to the peer.
    type WriteOnCloser struct {
    	io.Writer
    	hasWritten bool
    }
    
    func (w *WriteOnCloser) Write(p []byte) (int, error) {
    	w.hasWritten = true
    	return w.Writer.Write(p)
    }
    
    // Close closes the WriteOnCloser. It behaves like io.Closer.
    func (w *WriteOnCloser) Close() error {
    	if !w.hasWritten {
    		_, err := w.Write(nil)
    		if err != nil {
    			return err
    		}
    	}
    Go
    - Registered: Sun Apr 21 19:28:08 GMT 2024
    - Last Modified: Fri Apr 19 11:26:59 GMT 2024
    - 10.3K bytes
    - Viewed (0)
  3. docs/debugging/inspect/export.go

    			if e != nil {
    				return e
    			}
    			// Quote string...
    			b, _ := json.Marshal(file.Name)
    			if hasWritten {
    				fmt.Print(",\n")
    			}
    			fmt.Printf("\t%s: ", string(b))
    
    			b, e = decode(r, file.Name)
    			if e != nil {
    				return e
    			}
    			fmt.Print(string(b))
    			hasWritten = true
    		}
    	}
    	fmt.Println("")
    	fmt.Println("}")
    
    	return nil
    }
    
    var (
    Go
    - Registered: Sun Apr 28 19:28:10 GMT 2024
    - Last Modified: Tue Nov 08 15:58:02 GMT 2022
    - 9.1K bytes
    - Viewed (0)
  4. cmd/s3-zip-handlers.go

    	if _, err = xioutil.Copy(httpWriter, rc); err != nil {
    		if !httpWriter.HasWritten() {
    			// write error response only if no data or headers has been written to client yet
    			writeErrorResponse(ctx, w, toAPIError(ctx, err), r.URL)
    			return
    		}
    		return
    	}
    
    	if err = httpWriter.Close(); err != nil {
    		if !httpWriter.HasWritten() { // write error response only if no data or headers has been written to client yet
    Go
    - Registered: Sun Apr 28 19:28:10 GMT 2024
    - Last Modified: Tue Apr 09 10:41:25 GMT 2024
    - 15.8K bytes
    - Viewed (0)
  5. cmd/object-handlers.go

    	if _, err = xioutil.Copy(httpWriter, gr); err != nil {
    		if !httpWriter.HasWritten() && !statusCodeWritten {
    			// write error response only if no data or headers has been written to client yet
    			writeErrorResponse(ctx, w, toAPIError(ctx, err), r.URL)
    			return
    		}
    		return
    	}
    
    	if err = httpWriter.Close(); err != nil {
    Go
    - Registered: Sun Apr 28 19:28:10 GMT 2024
    - Last Modified: Mon Apr 22 17:49:30 GMT 2024
    - 125K bytes
    - Viewed (0)
Back to top