diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 46d6a064..0491f945 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -3,7 +3,7 @@ trigger: include: - '*' variables: - GO_VERSION: "1.25.5" + GO_VERSION: "1.26.5" NODE_VERSION: "22.x" DOCKER_BUILDKIT: 1 diff --git a/go.mod b/go.mod index 12bd255d..c1af5f64 100644 --- a/go.mod +++ b/go.mod @@ -1,8 +1,8 @@ module github.com/cloudreve/Cloudreve/v4 -go 1.25.0 +go 1.26.0 -toolchain go1.25.5 +toolchain go1.26.5 require ( entgo.io/ent v0.13.0 diff --git a/pkg/filemanager/driver/remote/client.go b/pkg/filemanager/driver/remote/client.go index fe7e095b..34041eab 100644 --- a/pkg/filemanager/driver/remote/client.go +++ b/pkg/filemanager/driver/remote/client.go @@ -4,6 +4,7 @@ import ( "bytes" "context" "encoding/json" + "errors" "fmt" "io" "net/http" @@ -177,7 +178,7 @@ func (c *remoteClient) DeleteFiles(ctx context.Context, files ...string) ([]stri if resp.Code == serializer.CodeNotFullySuccess { resp.GobDecode(&failed) } - return failed, fmt.Errorf(resp.Error) + return failed, errors.New(resp.Error) } return nil, nil @@ -196,7 +197,7 @@ func (c *remoteClient) MediaMeta(ctx context.Context, src, ext, language string) } if resp.Code != 0 { - return nil, fmt.Errorf(resp.Error) + return nil, errors.New(resp.Error) } var metas []driver.MediaMeta diff --git a/pkg/filemanager/fs/dbfs/dbfs.go b/pkg/filemanager/fs/dbfs/dbfs.go index f1c74503..e350d932 100644 --- a/pkg/filemanager/fs/dbfs/dbfs.go +++ b/pkg/filemanager/fs/dbfs/dbfs.go @@ -764,7 +764,7 @@ func (f *DBFS) getNavigator(ctx context.Context, path *fs.URI, requiredCapabilit capabilities := res.Capabilities(false).Capability for _, capability := range requiredCapabilities { if !capabilities.Enabled(int(capability)) { - return nil, fs.ErrNotSupportedAction.WithError(fmt.Errorf("action %q is not supported under current fs", capability)) + return nil, fs.ErrNotSupportedAction.WithError(fmt.Errorf("action %v is not supported under current fs", capability)) } } diff --git a/pkg/filemanager/fs/dbfs/lock.go b/pkg/filemanager/fs/dbfs/lock.go index 3ebdd26d..cee880f4 100644 --- a/pkg/filemanager/fs/dbfs/lock.go +++ b/pkg/filemanager/fs/dbfs/lock.go @@ -319,7 +319,7 @@ func lockTupleFromUri(uri *fs.URI, u *ent.User, hasher hashid.Encoder) (string, if id == "" { id = strconv.Itoa(u.ID) } - ns := fmt.Sprintf(id + "/" + string(uri.FileSystem())) + ns := id + "/" + string(uri.FileSystem()) root := uri.Path() return ns, root, ns + "/" + root } diff --git a/pkg/filemanager/fs/dbfs/manage.go b/pkg/filemanager/fs/dbfs/manage.go index 3f97abf6..8f28f1b2 100644 --- a/pkg/filemanager/fs/dbfs/manage.go +++ b/pkg/filemanager/fs/dbfs/manage.go @@ -54,7 +54,7 @@ func (f *DBFS) Create(ctx context.Context, path *fs.URI, fileType types.FileType // File with the same name but different type already exist return nil, fs.ErrFileExisted. - WithError(fmt.Errorf("object with the same name but different type %q already exist", ancestor.Type())) + WithError(fmt.Errorf("object with the same name but different type %v already exist", ancestor.Type())) } if _, ok := ctx.Value(ByPassOwnerCheckCtxKey{}).(bool); !ok && ancestor.Owner().ID != f.user.ID {