Description

A RegretableReader will allow you to read from a reader, and then to "regret" reading it, and push back everything you've read. For example,

rb := NewRegretableReader(bytes.NewBuffer([]byte{1,2,3}))
var b = make([]byte,1)
rb.Read(b) // b[0] = 1
rb.Regret()
ioutil.ReadAll(rb.Read) // returns []byte{1,2,3},nil

RegretableReader is referenced in 1 repository

github.com/elazarl/goproxy