1
0
mirror of https://github.com/duke-git/lancet.git synced 2026-03-01 00:35:28 +08:00

refactor: update param name CopyFile

This commit is contained in:
dudaodong
2023-04-25 10:49:12 +08:00
parent 62891f20f8
commit fa81ee143e
3 changed files with 5 additions and 5 deletions
+1 -1
View File
@@ -131,7 +131,7 @@ func main() {
<b>Signature:</b> <b>Signature:</b>
```go ```go
func CopyFile(srcFilePath string, dstFilePath string) error func CopyFile(srcPath string, dstPath string) error
``` ```
<b>Example:</b> <b>Example:</b>
+1 -1
View File
@@ -131,7 +131,7 @@ func main() {
<b>函数签名:</b> <b>函数签名:</b>
```go ```go
func CopyFile(srcFilePath string, dstFilePath string) error func CopyFile(srcPath string, dstPath string) error
``` ```
<b>示例:</b> <b>示例:</b>
+3 -3
View File
@@ -69,14 +69,14 @@ func RemoveFile(path string) error {
// CopyFile copy src file to dest file. // CopyFile copy src file to dest file.
// Play: https://go.dev/play/p/Jg9AMJMLrJi // Play: https://go.dev/play/p/Jg9AMJMLrJi
func CopyFile(srcFilePath string, dstFilePath string) error { func CopyFile(srcPath string, dstPath string) error {
srcFile, err := os.Open(srcFilePath) srcFile, err := os.Open(srcPath)
if err != nil { if err != nil {
return err return err
} }
defer srcFile.Close() defer srcFile.Close()
distFile, err := os.Create(dstFilePath) distFile, err := os.Create(dstPath)
if err != nil { if err != nil {
return err return err
} }