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

Fix a bug in example/fib/app.go line:69 #2860

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion example/fib/app.go
Expand Up @@ -66,7 +66,7 @@ func (a *App) Poll(ctx context.Context) (uint, error) {
a.l.Print("What Fibonacci number would you like to know: ")

var n uint
_, err := fmt.Fscanf(a.r, "%d", &n)
_, err := fmt.Fscanf(a.r, "%d\n", &n)
if err != nil {
span.RecordError(err)
span.SetStatus(codes.Error, err.Error())
Expand Down
4 changes: 2 additions & 2 deletions website_docs/getting-started.md
Expand Up @@ -214,7 +214,7 @@ func (a *App) Poll(ctx context.Context) (uint, error) {
a.l.Print("What Fibonacci number would you like to know: ")

var n uint
_, err := fmt.Fscanf(a.r, "%d", &n)
_, err := fmt.Fscanf(a.r, "%d\n", &n)

// Store n as a string to not overflow an int64.
nStr := strconv.FormatUint(uint64(n), 10)
Expand Down Expand Up @@ -458,7 +458,7 @@ func (a *App) Poll(ctx context.Context) (uint, error) {
a.l.Print("What Fibonacci number would you like to know: ")

var n uint
_, err := fmt.Fscanf(a.r, "%d", &n)
_, err := fmt.Fscanf(a.r, "%d\n", &n)
if err != nil {
span.RecordError(err)
span.SetStatus(codes.Error, err.Error())
Expand Down