From d342bdefa920b238b2966ea77d7b6e0c07ea1498 Mon Sep 17 00:00:00 2001 From: minquan chen Date: Wed, 27 Apr 2022 01:48:30 +0800 Subject: [PATCH] Fix a bug in example/fib/app.go line:69 (#2860) * modify the Fscanf function param in example/fib/app.go line:69 to avoid process break by "unexpected newline" * Add pull reqesut ID into CHANGELOG.md * append "\n" to the string param of Fscanf() in getting-started.md * delete a line in CHANGELOG.md. Co-authored-by: Tyler Yahn --- example/fib/app.go | 2 +- website_docs/getting-started.md | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) 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())