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

Typo in https://gokit.io/examples/stringsvc.html#client-side-endpoints #5

Open
j-mnr opened this issue Aug 4, 2022 · 0 comments
Open

Comments

@j-mnr
Copy link

j-mnr commented Aug 4, 2022

Typo with non-compiling code in documentation

Hello 👋 I'm going through the https://gokit.io/examples/stringsvc.html walkthrough right now and found a line that doesn't match up with endpoint.Endpoint's signature.

func (mw proxymw) Uppercase(s string) (string, error) {
	response, err := mw.uppercase(uppercaseRequest{S: s}) // 👈 This line doesn't work
	if err != nil {
		return "", err
	}
	resp := response.(uppercaseResponse)
	if resp.Err != "" {
		return resp.V, errors.New(resp.Err)
	}
	return resp.V, nil
}

Should be

func (mw proxymw) Uppercase(s string) (string, error) {
	response, err := mw.uppercase(context.Background(), uppercaseRequest{S: s})
	if err != nil {
		return "", err
	}
	resp := response.(uppercaseResponse)
	if resp.Err != "" {
		return resp.V, errors.New(resp.Err)
	}
	return resp.V, nil
}

Not sure where to address this, so if there is another location to bring this to let me know!

Cheers 🍻

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

No branches or pull requests

1 participant