Bytes returns a transformer that replaces all instances of old with new. Unlike bytes.Replace, empty old values don't match anything.
(old, new []byte)
| 41 | // Bytes returns a transformer that replaces all instances of old with new. |
| 42 | // Unlike bytes.Replace, empty old values don't match anything. |
| 43 | func Bytes(old, new []byte) Transformer { |
| 44 | return Transformer{old: old, new: new, oldlen: len(old)} |
| 45 | } |
| 46 | |
| 47 | // String returns a transformer that replaces all instances of old with new. |
| 48 | // Unlike strings.Replace, empty old values don't match anything. |