Documentation ¶
Overview ¶
Package stdio provide some standard IO util functions.
Index ¶
- func DiscardReader(src io.Reader)
- func MustReadReader(r io.Reader) []byte
- func NewIOReader(in any) io.Reader
- func NewScanner(in any) *bufio.Scanner
- func QuietFprint(w io.Writer, a ...any)
- func QuietFprintf(w io.Writer, tpl string, vs ...any)
- func QuietFprintln(w io.Writer, a ...any)
- func QuietWriteString(w io.Writer, ss ...string)
- func ReadString(r io.Reader) string
- func WriteByte(b byte)
- func WriteBytes(bs []byte)
- func WriteString(s string)
- func Writeln(s string)
- func WritelnBytes(bs []byte)
- type FlushCloseWriter
- type FlushWriter
- type Flusher
- type SyncCloseWriter
- type Syncer
- type WriteWrapper
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func MustReadReader ¶
MustReadReader read contents from io.Reader, will panic on error
func NewIOReader ¶ added in v0.6.2
NewIOReader instance by input: string, bytes, io.Reader
func NewScanner ¶ added in v0.6.2
NewScanner instance by input data or reader
func QuietFprint ¶ added in v0.5.6
QuietFprint to writer, will ignore error
func QuietFprintf ¶ added in v0.5.6
QuietFprintf to writer, will ignore error
func QuietFprintln ¶ added in v0.5.6
QuietFprintln to writer, will ignore error
func QuietWriteString ¶
QuietWriteString to writer, will ignore error
func ReadString ¶ added in v0.6.2
ReadString read contents from io.Reader, return empty string on error
func WriteBytes ¶ added in v0.6.7
func WriteBytes(bs []byte)
WriteBytes to stdout, will ignore error
func WriteString ¶ added in v0.6.7
func WriteString(s string)
WriteString to stdout, will ignore error
func WritelnBytes ¶ added in v0.6.8
func WritelnBytes(bs []byte)
WritelnBytes to stdout, will ignore error
Types ¶
type FlushCloseWriter ¶ added in v0.6.11
type FlushCloseWriter interface { Flusher // WriteCloser the output writer io.WriteCloser }
FlushCloseWriter is the interface satisfied by logging destinations.
type FlushWriter ¶ added in v0.6.11
FlushWriter is the interface satisfied by logging destinations.
type SyncCloseWriter ¶ added in v0.6.11
type SyncCloseWriter interface { Syncer // WriteCloser the output writer io.WriteCloser }
SyncCloseWriter is the interface satisfied by logging destinations. such as os.File
type WriteWrapper ¶
WriteWrapper warp io.Writer support more operate methods.
func (*WriteWrapper) Write ¶
func (w *WriteWrapper) Write(p []byte) (n int, err error)
Write bytes data
func (*WriteWrapper) WriteString ¶
func (w *WriteWrapper) WriteString(s string) (n int, err error)
WriteString data