From 07782276d444b3b6ee49aabb7bd9c1a497773f9f Mon Sep 17 00:00:00 2001 From: ILoveScratch Date: Mon, 27 Jul 2026 22:59:51 +0800 Subject: [PATCH] chore: fix typos --- cmd/crypt.go | 2 +- drivers/139/util.go | 2 +- drivers/crypt/driver.go | 2 +- drivers/lanzou/help.go | 2 +- drivers/lanzou/types.go | 4 ++-- drivers/lanzou/util.go | 12 ++++++------ server/handles/webauthn.go | 2 +- server/s3/pager.go | 2 +- 8 files changed, 14 insertions(+), 14 deletions(-) diff --git a/cmd/crypt.go b/cmd/crypt.go index 12f51f5cd..7cdb29258 100644 --- a/cmd/crypt.go +++ b/cmd/crypt.go @@ -23,7 +23,7 @@ type options struct { pwd string //de/encrypt password salt string - filenameEncryption string //reference drivers\crypt\meta.go Addtion + filenameEncryption string //reference drivers\crypt\meta.go Addition dirnameEncryption string filenameEncode string suffix string diff --git a/drivers/139/util.go b/drivers/139/util.go index b6187f76c..d8ce131cf 100644 --- a/drivers/139/util.go +++ b/drivers/139/util.go @@ -507,7 +507,7 @@ func (d *Yun139) shareHeaders() map[string]string { "User-Agent": "Mozilla/5.0 (X11; Linux x86_64; rv:140.0) Gecko/20100101 Firefox/140.0", "Accept": "application/json, text/plain, */*", "Content-Type": "application/json;charset=UTF-8", - "X-Deviceinfo": "||9|12.27.0|firefox|140.0|||linux unknow|1920X526|zh-CN|||", + "X-Deviceinfo": "||9|12.27.0|firefox|140.0|||linux unknown|1920X526|zh-CN|||", "hcy-cool-flag": "1", "CMS-DEVICE": "default", "x-m4c-caller": "PC", diff --git a/drivers/crypt/driver.go b/drivers/crypt/driver.go index 9e8b5c5c7..7dca84283 100644 --- a/drivers/crypt/driver.go +++ b/drivers/crypt/driver.go @@ -251,7 +251,7 @@ func (d *Crypt) Link(ctx context.Context, file model.Obj, _ model.LinkArgs) (*mo rrf, err := stream.GetRangeReaderFromLink(remoteSize, remoteLink) if err != nil { _ = remoteLink.Close() - return nil, fmt.Errorf("the remote storage driver need to be enhanced to support encrytion") + return nil, fmt.Errorf("the remote storage driver need to be enhanced to support encryption") } mu := &sync.Mutex{} diff --git a/drivers/lanzou/help.go b/drivers/lanzou/help.go index 930c72486..f2599b283 100644 --- a/drivers/lanzou/help.go +++ b/drivers/lanzou/help.go @@ -304,7 +304,7 @@ var findFromReg = regexp.MustCompile(`data : '(.+?)'`) // 查找from字符串 func htmlFormToMap(html string) (map[string]string, error) { forms := findFromReg.FindStringSubmatch(html) if len(forms) != 2 { - return nil, fmt.Errorf("not find file sgin") + return nil, fmt.Errorf("not find file sign") } return formToMap(forms[1]), nil } diff --git a/drivers/lanzou/types.go b/drivers/lanzou/types.go index dbce78874..4e6f481fd 100644 --- a/drivers/lanzou/types.go +++ b/drivers/lanzou/types.go @@ -132,7 +132,7 @@ type FileOrFolderByShareUrl struct { //T int `json:"t"` // 文件夹特有 - IsFloder bool `json:"-"` + IsFolder bool `json:"-"` // Url string `json:"-"` @@ -162,7 +162,7 @@ func (f *FileOrFolderByShareUrl) GetSize() int64 { } return *f.size } -func (f *FileOrFolderByShareUrl) IsDir() bool { return f.IsFloder } +func (f *FileOrFolderByShareUrl) IsDir() bool { return f.IsFolder } func (f *FileOrFolderByShareUrl) ModTime() time.Time { if f.time == nil { time := MustParseTime(f.Time) diff --git a/drivers/lanzou/util.go b/drivers/lanzou/util.go index e70154402..e451be249 100644 --- a/drivers/lanzou/util.go +++ b/drivers/lanzou/util.go @@ -572,14 +572,14 @@ func (d *LanZou) getFolderByShareUrl(pwd string, sharePageData string) ([]FileOr files := make([]FileOrFolderByShareUrl, 0) // vip获取文件夹 - floders := findSubFolderReg.FindAllStringSubmatch(sharePageData, -1) - for _, floder := range floders { - if len(floder) == 3 { + folders := findSubFolderReg.FindAllStringSubmatch(sharePageData, -1) + for _, folder := range folders { + if len(folder) == 3 { files = append(files, FileOrFolderByShareUrl{ // Pwd: pwd, // 子文件夹不加密 - ID: floder[1], - NameAll: floder[2], - IsFloder: true, + ID: folder[1], + NameAll: folder[2], + IsFolder: true, }) } } diff --git a/server/handles/webauthn.go b/server/handles/webauthn.go index 6848020fd..dee944965 100644 --- a/server/handles/webauthn.go +++ b/server/handles/webauthn.go @@ -95,7 +95,7 @@ func FinishAuthnLogin(c *gin.Context) { } else { // client-side discoverable login _, err = authnInstance.FinishDiscoverableLogin(func(_, userHandle []byte) (webauthn.User, error) { // first param `rawID` in this callback function is equal to ID in webauthn.Credential, - // but it's unnnecessary to check it. + // but it's unnecessary to check it. // userHandle param is equal to (User).WebAuthnID(). userID := uint(binary.LittleEndian.Uint64(userHandle)) user, err = db.GetUserById(userID) diff --git a/server/s3/pager.go b/server/s3/pager.go index 268242971..a607b1db5 100644 --- a/server/s3/pager.go +++ b/server/s3/pager.go @@ -8,7 +8,7 @@ import ( "github.com/itsHenry35/gofakes3" ) -// pager splits the object list into smulitply pages. +// pager splits the object list into multiple pages. func (db *s3Backend) pager(list *gofakes3.ObjectList, page gofakes3.ListBucketPage) (*gofakes3.ObjectList, error) { // sort by alphabet sort.Slice(list.CommonPrefixes, func(i, j int) bool {