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

Add a CopyFile method that takes in source as a string #354

Closed
dmikusa opened this issue Jul 15, 2024 · 0 comments
Closed

Add a CopyFile method that takes in source as a string #354

dmikusa opened this issue Jul 15, 2024 · 0 comments
Labels
type:enhancement A general enhancement

Comments

@dmikusa
Copy link
Contributor

dmikusa commented Jul 15, 2024

Describe the Enhancement

CopyFile takes in the file as the first argument and the dest as a string. This is nice, but often you have the source as a string too. Then the buildpack has to open the file first and pass that into CopyFile.

We should add a CopyFile method that takes string as the input.

Possible Solution

This will be a little tricky because Go doesn't support argument overloading, so we'll need to give it a different name, like CopyFileFrom.

Motivation

Reduce code in buildpacks, reduce error handling and potential problems from not handling errors correctly.

@dmikusa dmikusa added the type:enhancement A general enhancement label Jul 15, 2024
dmikusa added a commit that referenced this issue Oct 10, 2024
Resolves #354.

Adds CopyFileFrom convenience method that opens the source file and delegates to CopyFile.

Signed-off-by: Daniel Mikusa <[email protected]>
dmikusa added a commit that referenced this issue Oct 10, 2024
Resolves #354.

Adds CopyFileFrom convenience method that opens the source file and delegates to CopyFile.

Signed-off-by: Daniel Mikusa <[email protected]>
dmikusa added a commit that referenced this issue Oct 16, 2024
@dmikusa dmikusa closed this as completed Oct 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type:enhancement A general enhancement
Projects
None yet
Development

No branches or pull requests

1 participant