diff --git a/example/fib/app.go b/example/fib/app.go index 907779e613a..a92074258fb 100644 --- a/example/fib/app.go +++ b/example/fib/app.go @@ -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()) diff --git a/website_docs/getting-started.md b/website_docs/getting-started.md index 4262cd6ff83..5fdf2418187 100644 --- a/website_docs/getting-started.md +++ b/website_docs/getting-started.md @@ -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) @@ -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())