New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Decode push options in update request #968
base: master
Are you sure you want to change the base?
Decode push options in update request #968
Conversation
eae2f12
to
0c726c2
Compare
Signed-off-by: Nikolas Sepos <nikolas.sepos@gmail.com>
0c726c2
to
b353ec2
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A few nits, otherwise LGTM.
func errInvalidPushOption(err error) error { | ||
return errMalformedRequest(fmt.Sprintf( | ||
"invalid push option: %s", err.Error())) | ||
} | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
func errInvalidPushOption(err error) error { | |
return errMalformedRequest(fmt.Sprintf( | |
"invalid push option: %s", err.Error())) | |
} |
return &Option{Key: string(b)}, nil | ||
} | ||
if i == 0 { | ||
return nil, errInvalidPushOption(errors.New("empty option key")) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's create an ErrInvalidPushOption
var at the top of the file:
ErrInvalidPushOption = errors.New("invalid push option")
return nil, errInvalidPushOption(errors.New("empty option key")) | |
return nil, ErrInvalidPushOption |
No description provided.