Documentation
¶
Overview ¶
Package stdio provide some standard IO util functions.
Index ¶
- func DiscardReader(src io.Reader)
- func Fprint(w io.Writer, a ...any)
- func Fprintf(w io.Writer, tpl string, vs ...any)
- func Fprintln(w io.Writer, a ...any)
- func MustReadReader(r io.Reader) []byte
- func NewIOReader(in any) io.Reader
- func NewScanner(in any) *bufio.Scanner
- func ReadString(r io.Reader) string
- func SafeClose(c io.Closer)
- func WriteByte(b byte)
- func WriteBytes(bs []byte)
- func WriteString(s string)
- func WriteStringTo(w io.Writer, ss ...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 ¶
NewIOReader instance by input: string, bytes, io.Reader
func NewScanner ¶
NewScanner instance by input data or reader
func ReadString ¶
ReadString read contents from io.Reader, return empty string on error
func WriteStringTo ¶
WriteStringTo a writer, will ignore error
Types ¶
type FlushCloseWriter ¶
type FlushCloseWriter interface {
Flusher
// WriteCloser the output writer
io.WriteCloser
}
FlushCloseWriter is the interface satisfied by logging destinations.
type FlushWriter ¶
FlushWriter is the interface satisfied by logging destinations.
type SyncCloseWriter ¶
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
Click to show internal directories.
Click to hide internal directories.