refactor: obj name mapping and internal path processing (#2733)

* refactor:Prepare to remove the get interface

* feat:add obj Unwarp interface

* refactor:obj name mapping and program internal path processing

* chore: fix typo

* feat: unwrap get

* fix: no use op.Get to get parent id

* fix: set the path uniformly

Co-authored-by: Noah Hsu <i@nn.ci>
This commit is contained in:
foxxorcat
2022-12-17 19:49:05 +08:00
committed by GitHub
parent 3d336b328a
commit fb64f00640
50 changed files with 297 additions and 381 deletions

View File

@ -3,7 +3,6 @@ package utils
import (
"fmt"
"io"
"io/ioutil"
"mime"
"os"
"path"
@ -43,7 +42,7 @@ func CopyFile(src, dst string) error {
// CopyDir Dir copies a whole directory recursively
func CopyDir(src string, dst string) error {
var err error
var fds []os.FileInfo
var fds []os.DirEntry
var srcinfo os.FileInfo
if srcinfo, err = os.Stat(src); err != nil {
@ -52,7 +51,7 @@ func CopyDir(src string, dst string) error {
if err = os.MkdirAll(dst, srcinfo.Mode()); err != nil {
return err
}
if fds, err = ioutil.ReadDir(src); err != nil {
if fds, err = os.ReadDir(src); err != nil {
return err
}
for _, fd := range fds {