Documentation
¶
Overview ¶
Package io provides types that enable easy and more consistent input/output by wrapping the standard types
Index ¶
- type PanicWriter
- func (w *PanicWriter) FWrite(p ...interface{}) int
- func (w *PanicWriter) FWritef(format string, p ...interface{}) int
- func (w *PanicWriter) FWriteln(p ...interface{}) int
- func (w *PanicWriter) IndentWrites(spaces uint, writesFunc func(*PanicWriter))
- func (w *PanicWriter) IndentedWriter(spaces uint) io.Writer
- func (w *PanicWriter) Write(p []byte) int
- func (w *PanicWriter) WriteNewLine() int
- func (w *PanicWriter) WriteString(p string) int
- func (w *PanicWriter) WriteStringLine(p string) int
- func (w *PanicWriter) Writer() io.Writer
- type PanicWriterWriter
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type PanicWriter ¶
type PanicWriter struct {
// contains filtered or unexported fields
}
PanicWriter is a writer that panics if a write operation causes an error.
func NewPanicWriter ¶
func NewPanicWriter(writer io.Writer) *PanicWriter
NewPanicWriter returns a new PanicWriter based on a wrapped io.Writer.
func (*PanicWriter) FWrite ¶
func (w *PanicWriter) FWrite(p ...interface{}) int
FWrite writes the given args to the writer like fmt.Sprint(), and returns the number of bytes that were written. It'll panic if any error occurs during writing.
func (*PanicWriter) FWritef ¶
func (w *PanicWriter) FWritef(format string, p ...interface{}) int
FWritef writes the given args to the writer like fmt.Sprintf(), and returns the number of bytes that were written. It'll panic if any error occurs during writing.
func (*PanicWriter) FWriteln ¶
func (w *PanicWriter) FWriteln(p ...interface{}) int
FWriteln writes the given args to the writer like fmt.Sprintln(), and returns the number of bytes that were written. It'll panic if any error occurs during writing.
func (*PanicWriter) IndentWrites ¶
func (w *PanicWriter) IndentWrites(spaces uint, writesFunc func(*PanicWriter))
IndentWrites takes a number of spaces and a callback where all writes made in the callback are indented by the given space number. If the current writer is already indented, the number of spaces will be additive to the current number of contextual spaces.
func (*PanicWriter) IndentedWriter ¶
func (w *PanicWriter) IndentedWriter(spaces uint) io.Writer
IndentedWriter returns an io.Writer compatible version of the PanicWriter, with a number of spaces to indent all writes. If the current writer is already indented, the number of spaces will be additive to the current number of contextual spaces.
func (*PanicWriter) Write ¶
func (w *PanicWriter) Write(p []byte) int
Write writes a given string to the writer, and returns the number of bytes that were written. It'll panic if any error occurs during writing.
func (*PanicWriter) WriteNewLine ¶
func (w *PanicWriter) WriteNewLine() int
WriteNewLine writes a new-line character to the writer, and returns the number of bytes that were written. It'll panic if any error occurs during writing.
func (*PanicWriter) WriteString ¶
func (w *PanicWriter) WriteString(p string) int
WriteString writes a given string to the writer, and returns the number of bytes that were written. It'll panic if any error occurs during writing.
func (*PanicWriter) WriteStringLine ¶
func (w *PanicWriter) WriteStringLine(p string) int
WriteStringLine writes a given string to the writer with a new-line character after the given string, and returns the number of bytes that were written. It'll panic if any error occurs during writing.
func (*PanicWriter) Writer ¶
func (w *PanicWriter) Writer() io.Writer
Writer returns an io.Writer compatible version of the PanicWriter
type PanicWriterWriter ¶
type PanicWriterWriter PanicWriter
PanicWriterWriter is a writer that wraps the PanicWriter to provide an io.Writer compatible interface for callers