We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Context: https://tour.golang.org/methods/23
I've solved methods/23 like this:
func (old_reader rot13Reader) Read(b []byte) (int, error) { const LEN int = 1024 tmp_bytes := make([]byte, LEN) old_len, err := old_reader.r.Read(tmp_bytes) if err == nil { tmp_bytes = tmp_bytes[:old_len] rot13(tmp_bytes) return len(tmp_bytes), nil } else { return 0, err } } func main() { s := strings.NewReader("Lbh penpxrq gur pbqr!") r := rot13Reader{s} io.Copy(os.Stdout, &r) }
where rot13 is correct, but I can't see any output, process just exits. Debug output just before return len(tmp_bytes), nil shows correct string.
rot13
return len(tmp_bytes), nil
The text was updated successfully, but these errors were encountered:
Please ask about this on one of our discussion forums: https://golang.org/wiki/Questions
Sorry, something went wrong.
No branches or pull requests
Context: https://tour.golang.org/methods/23
I've solved methods/23 like this:
where
rot13
is correct, but I can't see any output, process just exits. Debug output just beforereturn len(tmp_bytes), nil
shows correct string.The text was updated successfully, but these errors were encountered: