ioutil

package
v2.11.0-rc.1 Latest Latest
Warning

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

Go to latest
Published: Feb 17, 2023 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Printf

func Printf(out io.Writer, format string, args ...any) int

Printf is like Fprintf but panics on error.

func Println

func Println(out io.Writer, txt string) int

Println is like Fprintln but panics on error.

func WriteAllTo

func WriteAllTo(out io.Writer, wts ...io.WriterTo) (tn int64, err error)

WriteAllTo calls WriteTo on all elements of the WriterTo slice and returns the total number of bytes written.

func WriteString added in v2.9.3

func WriteString(out io.Writer, s string) int

WriteString is like io.WriteString but panics on error.

Types

type KeyValueFormatter added in v2.9.3

type KeyValueFormatter struct {
	Prefix    string
	Indent    string
	Separator string
	// contains filtered or unexported fields
}

KeyValueFormatter will format each key/value pair added by Add so that they are prefixed with Prefix and have a vertically aligned ':' between the key and the value. Each pair is separated by a newline, and if a value contains newlines, then each line in that value, except the first one will be prefixed with `Prefix`, and Indent.

func DefaultKeyValueFormatter added in v2.9.3

func DefaultKeyValueFormatter() *KeyValueFormatter

func (*KeyValueFormatter) Add added in v2.9.3

func (f *KeyValueFormatter) Add(k, v string)

Add adds a key value pair that will be included in the formatted output.

func (*KeyValueFormatter) String added in v2.9.3

func (f *KeyValueFormatter) String() string

String returns the formatted output string.

func (*KeyValueFormatter) WriteTo added in v2.9.3

func (f *KeyValueFormatter) WriteTo(out io.Writer) (int64, error)

WriteTo writes the formatted output to the given io.Writer.

type WriterTos

type WriterTos interface {
	WriterTos() []io.WriterTo
}

WriterTos implements something that can be represented as a list of io.WriterTo.

Jump to

Keyboard shortcuts

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