writer

package
v0.0.0-...-d0f7b5f Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 19, 2018 License: MIT Imports: 4 Imported by: 0

Documentation

Overview

Package writer exports a simplified and customized writer.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Writer

type Writer struct {
	// contains filtered or unexported fields
}

Writer provides helpful utility methods and saves error handling till the end.

func New

func New(w io.Writer) *Writer

New wraps a standard io.Writer.

func (*Writer) Bs

func (w *Writer) Bs(p []byte) *Writer

Bs writes bytes.

func (*Writer) Err

func (w *Writer) Err() error

Err reports the first first error during processing.

func (*Writer) Int

func (w *Writer) Int(i int) *Writer

func (*Writer) Nl

func (w *Writer) Nl() *Writer

Nl renders a \n newline.

func (*Writer) Rune

func (w *Writer) Rune(r rune) *Writer

Rune writes a single rune.

func (*Writer) Sp

func (w *Writer) Sp() *Writer

Sp renders a space.

func (*Writer) Sticky

func (w *Writer) Sticky(err error) *Writer

Sticky given a nonnil error sets that to the stickied error, halting any further output

func (*Writer) Str

func (w *Writer) Str(s string) *Writer

Str writes strings.

func (*Writer) Stringer

func (w *Writer) Stringer(f fmt.Stringer) *Writer

Stringer writes the result of f.String() if w is not in an error state.

func (*Writer) Tab

func (w *Writer) Tab() *Writer

Tab renders a tab.

func (*Writer) Unwrap

func (w *Writer) Unwrap() io.Writer

Unwrap returns the underlying writer.

func (*Writer) With

func (w *Writer) With(f func(*Writer) error) *Writer

With runs f on this w if w is not in an error state and stickies any nonnil error returned by f.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL