-
Notifications
You must be signed in to change notification settings - Fork 20
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
all: modern build environment and dependencies #52
Conversation
Also update the Consul image to replace a removed image. The resulting PR will work in Github once vet errors are fixed.
I've deleted the CircleCI check since it's been replaced by Github Actions. |
response.go
Outdated
@@ -37,6 +37,7 @@ func (r Response) FrameType() FrameType { | |||
func (r Response) Write(w *bufio.Writer) (err error) { | |||
if err = writeFrameHeader(w, FrameTypeResponse, len(r)); err != nil { | |||
err = errors.WithMessage(err, "writing response message") | |||
return |
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.
I think this line for error cases when we trying call writeFrameHeader
if we will remove this return
it will try call w.WriteString(string(r))
I think we should keep it.
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.
OK - why do we assign to err
again here then? We never check the result, it gets overwritten.
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.
It is actually does : by calling return.
To be honest if we will keep this like this function will do this:
func (r Response) Write(w *bufio.Writer) error {
if err := writeFrameHeader(w, FrameTypeResponse, len(r)); err != nil {
return errors.WithMessage(err, "writing response message")
}
if _, err := w.WriteString(string(r)); err != nil {
return errors.Wrap(err, "writing response message")
}
return nil
}
If we will remove this line it will be this:
func (r Response) Write(w *bufio.Writer) error {
err := writeFrameHeader(w, FrameTypeResponse, len(r))
if err != nil {
err = errors.WithMessage(err, "writing response message")
}
if _, err := w.WriteString(string(r)); err != nil {
return errors.Wrap(err, "writing response message")
}
return err
}
As I understand :)
87bce2a
to
79edaca
Compare
Fixes vet errors and gets a CI environment up in Github Actions.