Skip to content

Commit

Permalink
lint: format
Browse files Browse the repository at this point in the history
  • Loading branch information
ishanarya0 committed Jun 18, 2024
1 parent 3e8af74 commit 455e4c7
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 11 deletions.
3 changes: 1 addition & 2 deletions core/servicedata/service.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,8 @@ import (
"github.com/goto/shield/core/resource"
"github.com/goto/shield/core/user"
"github.com/goto/shield/internal/schema"
"github.com/goto/shield/pkg/errors"
"github.com/goto/shield/pkg/db"

"github.com/goto/shield/pkg/errors"
)

const (
Expand Down
2 changes: 1 addition & 1 deletion core/servicedata/service_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ import (
"github.com/goto/shield/internal/schema"
errorsPkg "github.com/goto/shield/pkg/errors"
"github.com/goto/shield/pkg/logger"

"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/mock"
)
Expand Down
12 changes: 7 additions & 5 deletions internal/api/v1beta1/group.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,10 @@ type GroupService interface {
ListGroupRelations(ctx context.Context, objectId, subjectType, role string) ([]user.User, []group.Group, map[string][]string, map[string][]string, error)
}

var grpcGroupNotFoundErr = status.Errorf(codes.NotFound, "group doesn't exist")
var grpcInvalidOrgIDErr = status.Errorf(codes.InvalidArgument, "ordIs is not valid uuid")
var (
grpcGroupNotFoundErr = status.Errorf(codes.NotFound, "group doesn't exist")
grpcInvalidOrgIDErr = status.Errorf(codes.InvalidArgument, "ordIs is not valid uuid")
)

func (h Handler) ListGroups(ctx context.Context, request *shieldv1beta1.ListGroupsRequest) (*shieldv1beta1.ListGroupsResponse, error) {
logger := grpczap.Extract(ctx)
Expand Down Expand Up @@ -111,7 +113,7 @@ func (h Handler) CreateGroup(ctx context.Context, request *shieldv1beta1.CreateG
return nil, grpcInternalServerError
}

//TODO: change this
// TODO: change this
metaDataMap, err := metadata.Build(request.GetBody().GetMetadata().AsMap())
if err != nil {
logger.Error(err.Error())
Expand Down Expand Up @@ -240,7 +242,7 @@ func (h Handler) UpdateGroup(ctx context.Context, request *shieldv1beta1.UpdateG
return nil, grpcBadBodyError
}

//TODO: change this implementation
// TODO: change this implementation
metaDataMap, err := metadata.Build(request.GetBody().GetMetadata().AsMap())
if err != nil {
return nil, grpcBadBodyError
Expand Down Expand Up @@ -313,7 +315,7 @@ func (h Handler) UpdateGroup(ctx context.Context, request *shieldv1beta1.UpdateG
serviceDataMap[serviceDataResp.Key.Name] = serviceDataResp.Value
}

//Note: this would return only the keys that are updated in the current request
// Note: this would return only the keys that are updated in the current request
updatedGroup.Metadata = metaDataMap

groupPB, err := transformGroupToPB(updatedGroup)
Expand Down
1 change: 0 additions & 1 deletion internal/api/v1beta1/mocks/relation_service.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions internal/api/v1beta1/user.go
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,7 @@ func (h Handler) CreateUser(ctx context.Context, request *shieldv1beta1.CreateUs
serviceDataMap[serviceDataResp.Key.Name] = serviceDataResp.Value
}

//TODO: use serviceDataMap
// TODO: use serviceDataMap
newUser.Metadata = metaDataMap

userPB, err := transformUserToPB(newUser)
Expand Down Expand Up @@ -418,7 +418,7 @@ func (h Handler) UpdateUser(ctx context.Context, request *shieldv1beta1.UpdateUs
serviceDataMap[serviceDataResp.Key.Name] = serviceDataResp.Value
}

//Note: this would return only the keys that are updated in the current request
// Note: this would return only the keys that are updated in the current request
updatedUser.Metadata = metaDataMap

userPB, err := transformUserToPB(updatedUser)
Expand Down

0 comments on commit 455e4c7

Please sign in to comment.