-
-
Notifications
You must be signed in to change notification settings - Fork 2
Closed
Description
Hello,
I'm curious to know if it'd be possible to implement the ability for ios.NewBytesReplacingReader to ingest multiple old:new token mappings in the ios package.
This is obviously the current functionality of the interface:
package main
import (
"io"
"os"
"strings"
"github.com/jf-tech/go-corelib/ios"
)
func main() {
r := strings.NewReader("foo bar baz")
replacer := ios.NewBytesReplacingReader(r, []byte("foo bar baz"), []byte("baz bar foo"))
io.Copy(os.Stdout, replacer)
}Would it be too much trouble to get the functionality shown below?
package main
import (
"io"
"os"
"strings"
"github.com/jf-tech/go-corelib/ios"
)
func main() {
r := strings.NewReader("foo bar baz")
replacer := ios.NewBytesReplacingReader(r, [][]byte{[]byte("foo"), []byte("bar"), []byte("baz")}, [][]byte{[]byte("foo-new"), []byte("bar-new"), []byte("baz-new")})
io.Copy(os.Stdout, replacer) // returns "foo-new bar-new baz-new" to stdout
}Thanks a bunch.
Metadata
Metadata
Assignees
Labels
No labels