fmt

package
v0.0.10 Latest Latest
Warning

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

Go to latest
Published: Oct 12, 2019 License: MIT Imports: 4 Imported by: 0

Documentation

Overview

Package contains a writer for writing objects as formatted lines by wrapping the "fmt" package in the standard library. This package has a minimal API and should not replace general use of the standard library package.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Fprintf

func Fprintf(w io.Writer, format string, a ...interface{}) (int, error)

Fprintf formats according to a format specifier and writes to w. It returns the number of bytes written and any write error encountered.

Types

type Writer

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

Writer formats and writes objects to the underlying writer as formatted lines.

func NewWriter

func NewWriter(w io.Writer, format string, lineSeparator string) *Writer

NewWriter returns a writer for formating and writing objets to the underlying writer as formatted lines.

func (*Writer) Close

func (w *Writer) Close() error

Close closes the underlying writer, if it has a Close method.

func (*Writer) Flush

func (w *Writer) Flush() error

Flush flushes the underlying writer, if it has a Flush method. This writer itself does no buffering.

func (*Writer) WriteObject

func (w *Writer) WriteObject(obj interface{}) error

WriteObject formats and writes a single object to the underlying writer as a formatted line and appends the writer's line separator.

func (*Writer) WriteObjects

func (w *Writer) WriteObjects(objects interface{}) error

WriteObjects formats and writes the given objets to the underlying writer as formatted lines and separates the objects using the writer's line separator.

Jump to

Keyboard shortcuts

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