Skip to content

Commit

Permalink
Fix a bug in example/fib/app.go line:69 (#2860)
Browse files Browse the repository at this point in the history
* 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 <MrAlias@users.noreply.github.com>
  • Loading branch information
Frapschen and MrAlias committed Apr 26, 2022
1 parent fdfc821 commit d342bde
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
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

0 comments on commit d342bde

Please sign in to comment.