equal
deleted
inserted
replaced
76 // |
76 // |
77 // Callers should always account for the n bytes consumed before |
77 // Callers should always account for the n bytes consumed before |
78 // considering the error err. |
78 // considering the error err. |
79 // |
79 // |
80 // A nil error means that all input bytes are known to be identical to the |
80 // A nil error means that all input bytes are known to be identical to the |
81 // output produced by the Transformer. A nil error can be be returned |
81 // output produced by the Transformer. A nil error can be returned |
82 // regardless of whether atEOF is true. If err is nil, then then n must |
82 // regardless of whether atEOF is true. If err is nil, then n must |
83 // equal len(src); the converse is not necessarily true. |
83 // equal len(src); the converse is not necessarily true. |
84 // |
84 // |
85 // ErrEndOfSpan means that the Transformer output may differ from the |
85 // ErrEndOfSpan means that the Transformer output may differ from the |
86 // input after n bytes. Note that n may be len(src), meaning that the output |
86 // input after n bytes. Note that n may be len(src), meaning that the output |
87 // would contain additional bytes after otherwise identical output. |
87 // would contain additional bytes after otherwise identical output. |
491 err, c.errStart, c.err = c.err, 0, nil |
491 err, c.errStart, c.err = c.err, 0, nil |
492 } |
492 } |
493 return dstL.n, srcL.p, err |
493 return dstL.n, srcL.p, err |
494 } |
494 } |
495 |
495 |
496 // Deprecated: use runes.Remove instead. |
496 // Deprecated: Use runes.Remove instead. |
497 func RemoveFunc(f func(r rune) bool) Transformer { |
497 func RemoveFunc(f func(r rune) bool) Transformer { |
498 return removeF(f) |
498 return removeF(f) |
499 } |
499 } |
500 |
500 |
501 type removeF func(r rune) bool |
501 type removeF func(r rune) bool |