aboutsummaryrefslogtreecommitdiffstats
path: root/utils
diff options
context:
space:
mode:
authorAyman Bagabas <ayman.bagabas@gmail.com>2023-11-13 17:53:46 -0500
committerAyman Bagabas <ayman.bagabas@gmail.com>2023-11-13 18:02:20 -0500
commita28a4ac965f714e7506ba26212556fd3d9817712 (patch)
tree079a0e7944ec8280aa2d157b9fd6996d9ef941b9 /utils
parenta9509b0a52f116ea2969d51890a4265d98d50dcb (diff)
downloadgo-git-a28a4ac965f714e7506ba26212556fd3d9817712.tar.gz
utils: remove ioutil.Pipe and use std library io.Pipe
ioutil.Pipe literally calls io.Pipe.
Diffstat (limited to 'utils')
-rw-r--r--utils/ioutil/common.go12
-rw-r--r--utils/ioutil/pipe.go9
-rw-r--r--utils/ioutil/pipe_js.go9
3 files changed, 1 insertions, 29 deletions
diff --git a/utils/ioutil/common.go b/utils/ioutil/common.go
index b0ace4e..235af71 100644
--- a/utils/ioutil/common.go
+++ b/utils/ioutil/common.go
@@ -195,7 +195,7 @@ func NewWriterOnError(w io.Writer, notify func(error)) io.Writer {
}
// NewWriteCloserOnError returns a io.WriteCloser that call the notify function
-//when an unexpected (!io.EOF) error happens, after call Write function.
+// when an unexpected (!io.EOF) error happens, after call Write function.
func NewWriteCloserOnError(w io.WriteCloser, notify func(error)) io.WriteCloser {
return NewWriteCloser(NewWriterOnError(w, notify), w)
}
@@ -208,13 +208,3 @@ func (r *writerOnError) Write(p []byte) (n int, err error) {
return
}
-
-type PipeReader interface {
- io.ReadCloser
- CloseWithError(err error) error
-}
-
-type PipeWriter interface {
- io.WriteCloser
- CloseWithError(err error) error
-}
diff --git a/utils/ioutil/pipe.go b/utils/ioutil/pipe.go
deleted file mode 100644
index f30c452..0000000
--- a/utils/ioutil/pipe.go
+++ /dev/null
@@ -1,9 +0,0 @@
-// +build !js
-
-package ioutil
-
-import "io"
-
-func Pipe() (PipeReader, PipeWriter) {
- return io.Pipe()
-}
diff --git a/utils/ioutil/pipe_js.go b/utils/ioutil/pipe_js.go
deleted file mode 100644
index cf102e6..0000000
--- a/utils/ioutil/pipe_js.go
+++ /dev/null
@@ -1,9 +0,0 @@
-// +build js
-
-package ioutil
-
-import "github.com/acomagu/bufpipe"
-
-func Pipe() (PipeReader, PipeWriter) {
- return bufpipe.New(nil)
-}