From dda95368aa427d845418b08fddbba2d9b38fef66 Mon Sep 17 00:00:00 2001 From: Gianmaria Del Monte Date: Mon, 25 Sep 2023 15:41:32 +0200 Subject: [PATCH] fix linter2 --- internal/http/services/owncloud/ocs/conversions/role.go | 2 +- .../owncloud/ocs/handlers/apps/sharing/shares/public.go | 1 - .../owncloud/ocs/handlers/apps/sharing/shares/shares.go | 1 - pkg/utils/utils.go | 6 +++--- 4 files changed, 4 insertions(+), 6 deletions(-) diff --git a/internal/http/services/owncloud/ocs/conversions/role.go b/internal/http/services/owncloud/ocs/conversions/role.go index cc2b0604103..2d0587b3952 100644 --- a/internal/http/services/owncloud/ocs/conversions/role.go +++ b/internal/http/services/owncloud/ocs/conversions/role.go @@ -96,7 +96,7 @@ func (r *Role) OCSPermissions() Permissions { // S = Shared // R = Shareable // M = Mounted -// Z = Deniable (NEW) +// Z = Deniable (NEW). func (r *Role) WebDAVPermissions(isDir, isShared, isMountpoint, isPublic bool) string { var b strings.Builder if !isPublic && isShared { diff --git a/internal/http/services/owncloud/ocs/handlers/apps/sharing/shares/public.go b/internal/http/services/owncloud/ocs/handlers/apps/sharing/shares/public.go index fd341cb3ea8..342fa8a0d5a 100644 --- a/internal/http/services/owncloud/ocs/handlers/apps/sharing/shares/public.go +++ b/internal/http/services/owncloud/ocs/handlers/apps/sharing/shares/public.go @@ -245,7 +245,6 @@ func (h *Handler) listPublicShares(r *http.Request, filters []*link.ListPublicSh } return ocsDataPayload, nil, nil - } func (h *Handler) isPublicShare(r *http.Request, oid string) bool { diff --git a/internal/http/services/owncloud/ocs/handlers/apps/sharing/shares/shares.go b/internal/http/services/owncloud/ocs/handlers/apps/sharing/shares/shares.go index 2933428c260..44a8309dd2e 100644 --- a/internal/http/services/owncloud/ocs/handlers/apps/sharing/shares/shares.go +++ b/internal/http/services/owncloud/ocs/handlers/apps/sharing/shares/shares.go @@ -919,7 +919,6 @@ func (h *Handler) listSharesWithMe(w http.ResponseWriter, r *http.Request) { h.logProblems(status, err, "could not stat, skipping", log) return } - } data, err := conversions.CS3Share2ShareData(r.Context(), rs.Share) diff --git a/pkg/utils/utils.go b/pkg/utils/utils.go index 4c7ce121335..e962c1badf4 100644 --- a/pkg/utils/utils.go +++ b/pkg/utils/utils.go @@ -42,8 +42,8 @@ import ( "go.step.sm/crypto/randutil" // gocritic is disabled because google.golang.org/protobuf/proto does not provide a method to convert MessageV1 to MessageV2. - "github.com/golang/protobuf/proto" //nolint:staticcheck "google.golang.org/protobuf/encoding/protojson" + "google.golang.org/protobuf/proto" ) var ( @@ -210,14 +210,14 @@ func IsValidName(name string) bool { // MarshalProtoV1ToJSON marshals a proto V1 message to a JSON byte array // TODO: update this once we start using V2 in CS3APIs. func MarshalProtoV1ToJSON(m proto.Message) ([]byte, error) { - mV2 := proto.MessageV2(m) + mV2 := proto.Message(m) return protojson.Marshal(mV2) } // UnmarshalJSONToProtoV1 decodes a JSON byte array to a specified proto message type // TODO: update this once we start using V2 in CS3APIs. func UnmarshalJSONToProtoV1(b []byte, m proto.Message) error { - mV2 := proto.MessageV2(m) + mV2 := proto.Message(m) if err := protojson.Unmarshal(b, mV2); err != nil { return err }