Skip to content

Commit

Permalink
Fix wording
Browse files Browse the repository at this point in the history
  • Loading branch information
otiai10 committed Mar 6, 2020
1 parent df82c8d commit 99ee8e8
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions copy.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ const (
tmpPermissionForDirectory = os.FileMode(0755)
)

// Copy copies src to dest, doesn't matter if src is a directory or a file
// Copy copies src to dest, doesn't matter if src is a directory or a file.
func Copy(src, dest string, opt ...Options) error {
info, err := os.Lstat(src)
if err != nil {
Expand Down Expand Up @@ -134,15 +134,17 @@ func lcopy(src, dest string) error {
}

// fclose ANYHOW closes file,
// with asiging error occured BUT respecting the error already reported.
// with asiging error raised during Close,
// BUT respecting the error already reported.
func fclose(f *os.File, reported *error) {
if err := f.Close(); *reported == nil {
*reported = err
}
}

// chmod ANYHOW changes file mode,
// with asiging error occured BUT respecting the error already reported.
// with asiging error raised during Chmod,
// BUT respecting the error already reported.
func chmod(dir string, mode os.FileMode, reported *error) {
if err := os.Chmod(dir, mode); *reported == nil {
*reported = err
Expand Down

0 comments on commit 99ee8e8

Please sign in to comment.