forked from forgejo/forgejo
migrate from com.* to alternatives (#14103)
* remove github.com/unknwon/com from models * dont use "com.ToStr()" * replace "com.ToStr" with "fmt.Sprint" where its easy to do * more refactor * fix test * just "proxy" Copy func for now * as per @lunny
This commit is contained in:
parent
04ae0f2f3f
commit
a19447aed1
46 changed files with 230 additions and 220 deletions
20
modules/util/copy.go
Normal file
20
modules/util/copy.go
Normal file
|
@ -0,0 +1,20 @@
|
|||
// Copyright 2020 The Gitea Authors. All rights reserved.
|
||||
// Use of this source code is governed by a MIT-style
|
||||
// license that can be found in the LICENSE file.
|
||||
|
||||
package util
|
||||
|
||||
import (
|
||||
"github.com/unknwon/com"
|
||||
)
|
||||
|
||||
// CopyFile copies file from source to target path.
|
||||
func CopyFile(src, dest string) error {
|
||||
return com.Copy(src, dest)
|
||||
}
|
||||
|
||||
// CopyDir copy files recursively from source to target directory.
|
||||
// It returns error when error occurs in underlying functions.
|
||||
func CopyDir(srcPath, destPath string) error {
|
||||
return com.CopyDir(srcPath, destPath)
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue