format

package
v0.0.0-...-8efffb4 Latest Latest
Warning

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

Go to latest
Published: Jan 11, 2023 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type State

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

State wraps the state into desired writer

func NewState

func NewState(state fmt.State) *State

NewState creates a new state

func (*State) Flag

func (w *State) Flag(c int) bool

Flag reports whether the flag c, a character, has been set.

func (*State) Flush

func (w *State) Flush() error

Flush flushes the state

func (*State) Precision

func (w *State) Precision() (prec int, ok bool)

Precision returns the value of the precision option and whether it has been set.

func (*State) Size

func (w *State) Size() int

Size returns the size

func (*State) Width

func (w *State) Width() (wid int, ok bool)

Width returns the value of the width option and whether it has been set.

func (*State) Write

func (w *State) Write(data []byte) (n int, err error)

Write is the function to call to emit formatted output to be printed.

type StateFlusher

type StateFlusher interface {
	// Write is the function to call to emit formatted output to be printed.
	Write(b []byte) (n int, err error)
	// Width returns the value of the width option and whether it has been set.
	Width() (wid int, ok bool)
	// Precision returns the value of the precision option and whether it has been set.
	Precision() (prec int, ok bool)
	// Flag reports whether the flag c, a character, has been set.
	Flag(c int) bool
	// Flush flushes the state
	Flush() error
}

StateFlusher is a flushable state

type StringSlice

type StringSlice []string

StringSlice represents a slice of string

func (StringSlice) Format

func (d StringSlice) Format(state fmt.State, verb rune)

Format formats the string slice

Directories

Path Synopsis
Code generated by counterfeiter.
Code generated by counterfeiter.

Jump to

Keyboard shortcuts

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