Skip to content
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

Merged
merged 3 commits into from
Mar 6, 2024
Merged

Conversation

kevinburkesegment
Copy link
Contributor

Fixes vet errors and gets a CI environment up in Github Actions.

Also update the Consul image to replace a removed image. The resulting
PR will work in Github once vet errors are fixed.
@kevinburkesegment
Copy link
Contributor Author

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
Copy link
Contributor

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.

Copy link
Contributor Author

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.

Copy link
Contributor

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 :)

@kevinburkesegment kevinburkesegment merged commit 79edaca into master Mar 6, 2024
4 checks passed
@kevinburkesegment kevinburkesegment deleted the modtidy branch March 6, 2024 22:12
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