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:
+1
-1
@@ -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>
|
||||||
|
|||||||
@@ -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
@@ -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
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user