gopatch
gopatch copied to clipboard
Expose api for embed in user program.
All apis in gopatch is internal, user must invoke this by external command, pre-requirements is gopatch installed in user machine.
So expose api for embed is convenient
The choice to hide APIs was made due to an overabundance of caution. I think it's valid that a small surface area could be exposed—more over time as internals are solidified.
As a starting point to iterate on, I think something like following could be safely exposed while keeping the internals hidden.
type PatchFile struct{ ... }
func Parse(filename string, src []byte) (*PatchFile, error)
func (*PatchFile) Apply(src []byte) ([]byte, error)
CC @lverma14 @r-hang
internal ref: GO-2003