Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Expose api for embed in user program. #94

Open
leaxoy opened this issue Mar 19, 2023 · 2 comments
Open

Expose api for embed in user program. #94

leaxoy opened this issue Mar 19, 2023 · 2 comments
Labels
enhancement New feature or request

Comments

@leaxoy
Copy link

leaxoy commented Mar 19, 2023

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

@abhinav
Copy link
Contributor

abhinav commented Apr 25, 2023

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

@sywhang sywhang added the enhancement New feature or request label Apr 25, 2023
@sywhang
Copy link
Contributor

sywhang commented Apr 25, 2023

internal ref: GO-2003

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Development

No branches or pull requests

3 participants