github.com/yandex/pandora@v0.5.32/lib/ioutil2/funcs.go (about) 1 package ioutil2 2 3 type ReaderFunc func(p []byte) (n int, err error) 4 type WriterFunc func(p []byte) (n int, err error) 5 type CloserFunc func() error 6 7 func (f ReaderFunc) Read(p []byte) (int, error) { return f(p) } 8 func (f WriterFunc) Write(p []byte) (int, error) { return f(p) } 9 func (f CloserFunc) Close() error { return f() } 10 11 type StringerFunc func() string 12 13 func (f StringerFunc) String() string { return f() }