-
Notifications
You must be signed in to change notification settings - Fork 0
Closed
Description
Implement a new function Copy in the file package to copy a file from a source path to a destination path, preserving file content and permissions.
Acceptance Criteria
- Add
Copy(src, dst string) errorto thefilepackage. - The function should:
- Copy the file's content from
srctodst. - Overwrite
dstif it exists, or create it if it doesn't. - Preserve the file mode (permissions) from the source file.
- Return an error if the operation fails.
- Copy the file's content from
- Add GoDoc documentation for the function.
- Include basic unit tests (using testify) to verify correct behavior.
Example usage:
err := file.Copy("foo.txt", "bar.txt")
if err != nil {
log.Fatal(err)
}This utility will make it easier to copy files in Go projects using fsok.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or request