diff --git a/drivers/lanzou/help.go b/drivers/lanzou/help.go index 68a2b4c6..b019ea0d 100644 --- a/drivers/lanzou/help.go +++ b/drivers/lanzou/help.go @@ -146,16 +146,16 @@ func IsNumber(str string) bool { var findFromReg = regexp.MustCompile(`data : '(.+?)'`) // 查找from字符串 -// 解析html中的from +// 解析html中的form func htmlFormToMap(html string) (map[string]string, error) { - froms := findFromReg.FindStringSubmatch(html) - if len(froms) != 2 { + forms := findFromReg.FindStringSubmatch(html) + if len(forms) != 2 { return nil, fmt.Errorf("not find file sgin") } - return fromToMap(froms[1]), nil + return formToMap(forms[1]), nil } -func fromToMap(from string) map[string]string { +func formToMap(from string) map[string]string { var param = make(map[string]string) for _, kv := range strings.Split(from, "&") { kv := strings.SplitN(kv, "=", 2)[:2] diff --git a/drivers/webdav/odrvcookie/fetch.go b/drivers/webdav/odrvcookie/fetch.go index 142e934b..93fa87ae 100644 --- a/drivers/webdav/odrvcookie/fetch.go +++ b/drivers/webdav/odrvcookie/fetch.go @@ -119,7 +119,7 @@ func (ca *CookieAuth) getSPCookie(conf *SuccessResponse) (CookieResponse, error) Jar: jar, } - // Send the previously aquired Token as a Post parameter + // Send the previously acquired Token as a Post parameter if _, err = client.Post(u.String(), "text/xml", strings.NewReader(conf.Succ.Token)); err != nil { return CookieResponse{}, err } diff --git a/pkg/aria2/rpc/README.md b/pkg/aria2/rpc/README.md index 076349bd..a7191f5f 100644 --- a/pkg/aria2/rpc/README.md +++ b/pkg/aria2/rpc/README.md @@ -191,7 +191,7 @@ func (id *Client) PauseAll() (g string, err error) `aria2.pauseAll()` This method is equal to calling `aria2.pause()` for every active/waiting download. This methods returns OK for success. ``` -func (id *Client) PurgeDowloadResult() (g string, err error) +func (id *Client) PurgeDownloadResult() (g string, err error) ``` `aria2.purgeDownloadResult()` This method purges completed/error/removed downloads to free memory. This method returns OK. @@ -254,4 +254,4 @@ func (id *Client) Unpause(gid string) (g string, err error) func (id *Client) UnpauseAll() (g string, err error) ``` -`aria2.unpauseAll()` This method is equal to calling `aria2.unpause()` for every active/waiting download. This methods returns OK for success. \ No newline at end of file +`aria2.unpauseAll()` This method is equal to calling `aria2.unpause()` for every active/waiting download. This methods returns OK for success. diff --git a/pkg/aria2/rpc/call.go b/pkg/aria2/rpc/call.go index bd7d1f14..a2af8461 100644 --- a/pkg/aria2/rpc/call.go +++ b/pkg/aria2/rpc/call.go @@ -28,7 +28,7 @@ type httpCaller struct { once sync.Once } -func newHTTPCaller(ctx context.Context, u *url.URL, timeout time.Duration, notifer Notifier) *httpCaller { +func newHTTPCaller(ctx context.Context, u *url.URL, timeout time.Duration, notifier Notifier) *httpCaller { c := &http.Client{ Transport: &http.Transport{ MaxIdleConnsPerHost: 1, @@ -45,8 +45,8 @@ func newHTTPCaller(ctx context.Context, u *url.URL, timeout time.Duration, notif var wg sync.WaitGroup ctx, cancel := context.WithCancel(ctx) h := &httpCaller{uri: u.String(), c: c, cancel: cancel, wg: &wg} - if notifer != nil { - h.setNotifier(ctx, *u, notifer) + if notifier != nil { + h.setNotifier(ctx, *u, notifier) } return h } @@ -59,7 +59,7 @@ func (h *httpCaller) Close() (err error) { return } -func (h *httpCaller) setNotifier(ctx context.Context, u url.URL, notifer Notifier) (err error) { +func (h *httpCaller) setNotifier(ctx context.Context, u url.URL, notifier Notifier) (err error) { u.Scheme = "ws" conn, _, err := websocket.DefaultDialer.Dial(u.String(), nil) if err != nil { @@ -101,17 +101,17 @@ func (h *httpCaller) setNotifier(ctx context.Context, u url.URL, notifer Notifie } switch request.Method { case "aria2.onDownloadStart": - notifer.OnDownloadStart(request.Params) + notifier.OnDownloadStart(request.Params) case "aria2.onDownloadPause": - notifer.OnDownloadPause(request.Params) + notifier.OnDownloadPause(request.Params) case "aria2.onDownloadStop": - notifer.OnDownloadStop(request.Params) + notifier.OnDownloadStop(request.Params) case "aria2.onDownloadComplete": - notifer.OnDownloadComplete(request.Params) + notifier.OnDownloadComplete(request.Params) case "aria2.onDownloadError": - notifer.OnDownloadError(request.Params) + notifier.OnDownloadError(request.Params) case "aria2.onBtDownloadComplete": - notifer.OnBtDownloadComplete(request.Params) + notifier.OnBtDownloadComplete(request.Params) default: log.Printf("unexpected notification: %s", request.Method) } diff --git a/pkg/gowebdav/utils_test.go b/pkg/gowebdav/utils_test.go index 04410fd0..db7b0229 100644 --- a/pkg/gowebdav/utils_test.go +++ b/pkg/gowebdav/utils_test.go @@ -17,7 +17,7 @@ func TestJoin(t *testing.T) { func eq(t *testing.T, expected string, s0 string, s1 string) { s := Join(s0, s1) if s != expected { - t.Error("For", "'"+s0+"','"+s1+"'", "expeted", "'"+expected+"'", "got", "'"+s+"'") + t.Error("For", "'"+s0+"','"+s1+"'", "expected", "'"+expected+"'", "got", "'"+s+"'") } } diff --git a/pkg/utils/file.go b/pkg/utils/file.go index dbe64a02..cb580ba7 100644 --- a/pkg/utils/file.go +++ b/pkg/utils/file.go @@ -88,7 +88,7 @@ func CreateNestedFile(path string) (*os.File, error) { if !Exists(basePath) { err := os.MkdirAll(basePath, 0700) if err != nil { - log.Errorf("can't create foler,%s", err) + log.Errorf("can't create folder, %s", err) return nil, err } }