整个包结构重构

This commit is contained in:
hoteas
2021-05-24 07:27:41 +08:00
parent 77ded19742
commit 9bc930750d
23 changed files with 245 additions and 202 deletions
+3 -3
View File
@@ -1,8 +1,8 @@
package download
import (
. "../../common"
"bytes"
"code.hoteas.com/golang/hotime"
"io"
"io/ioutil"
"net/http"
@@ -13,11 +13,11 @@ import (
func Down(url, path, name string) bool {
os.MkdirAll(path, os.ModeDir)
if hotime.Substr(path, len(path)-1, len(path)) != "/" {
if Substr(path, len(path)-1, len(path)) != "/" {
path = path + "/"
}
out, err := os.Create(path + name)
e := hotime.Error{}
e := Error{}
if err != nil {
e.SetError(err)
return false