Skip to content

Commit d342bde

Browse files
FrapschenMrAlias
andauthored
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 <[email protected]>
1 parent fdfc821 commit d342bde

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

example/fib/app.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ func (a *App) Poll(ctx context.Context) (uint, error) {
6666
a.l.Print("What Fibonacci number would you like to know: ")
6767

6868
var n uint
69-
_, err := fmt.Fscanf(a.r, "%d", &n)
69+
_, err := fmt.Fscanf(a.r, "%d\n", &n)
7070
if err != nil {
7171
span.RecordError(err)
7272
span.SetStatus(codes.Error, err.Error())

website_docs/getting-started.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -214,7 +214,7 @@ func (a *App) Poll(ctx context.Context) (uint, error) {
214214
a.l.Print("What Fibonacci number would you like to know: ")
215215

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

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

460460
var n uint
461-
_, err := fmt.Fscanf(a.r, "%d", &n)
461+
_, err := fmt.Fscanf(a.r, "%d\n", &n)
462462
if err != nil {
463463
span.RecordError(err)
464464
span.SetStatus(codes.Error, err.Error())

0 commit comments

Comments
 (0)