Skip to content

Commit

Permalink
fix linter2
Browse files Browse the repository at this point in the history
  • Loading branch information
gmgigi96 committed Sep 25, 2023
1 parent 7a68c5c commit dda9536
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 6 deletions.
2 changes: 1 addition & 1 deletion internal/http/services/owncloud/ocs/conversions/role.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
6 changes: 3 additions & 3 deletions pkg/utils/utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 (
Expand Down Expand Up @@ -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
}
Expand Down

0 comments on commit dda9536

Please sign in to comment.