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.
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.