Skip to content

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

Description

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 馃嵒

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions