Closed
Description
The single Applier
type does some messy internal state tracking to avoid mixing ApplyFile
, ApplyTextFragment
, and ApplyBinaryFragment
. I think the following would be better:
- Create a
TextApplier
(inapply_text.go
) andBinaryApplier
(inapply_binary.go
). Each of these has methods to apply single fragments (and multiple fragments, in the case ofTextApplier
.) - Remove the
Reset
method and renameFlush
toClose
to better indicate that apply types are single-use - Remove the
Applier
type and theApplyFile
method - Move the logic for
ApplyFile
to the globalApply
function. This is the convenience function to select an applier based on the file type and execute it.
This should reduce confusion and provides an obvious place for the eventual text-only options for fuzzy apply.