Skip to content

[MR-1] для интервью#1

Open
rcv911 wants to merge 1 commit into
mainfrom
interview-1
Open

[MR-1] для интервью#1
rcv911 wants to merge 1 commit into
mainfrom
interview-1

Conversation

@rcv911
Copy link
Copy Markdown
Owner

@rcv911 rcv911 commented Nov 29, 2024

No description provided.

Comment thread cmd/main.go
func initLogger(level string) (zerolog.Logger, error) {
l, err := zerolog.ParseLevel(level)
if err != nil {
return zerolog.Logger{}, fmt.Errorf("getting log level error [%w]", err)
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

нужно l

Color: color,
}

r.storage[newCat.ID] = newCat
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

не хватает new id

return nil, status.Error(codes.Internal, err.Error())
}

return &cat_admin_v1.CatResponse{}, nil
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

нарушение контракта

func (s *CatAdminServiceServer) GetCat(ctx context.Context, req *cat_admin_v1.GetCatRequest) (*cat_admin_v1.CatResponse, error) {
cat, err := s.repo.GetCat(req.GetId())
if err != nil {
return nil, status.Errorf(codes.Internal, "failed get cat: %v", err)
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

нужно - %w

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants