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 3 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
1 change: 1 addition & 0 deletions CHANGELOG.md
Expand Up @@ -23,6 +23,7 @@ This project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.htm
- Delegated instruments are unwrapped before delegating Callbacks. (#2784)
- Resolve supply-chain failure for the markdown-link-checker GitHub action by calling the CLI directly. (#2834)
- Remove import of `testing` package in non-tests builds. (#2786)
- modify the Fscanf function param in example/fib/app.go line:69 to avoid process break by "unexpected newline". (#2860)
MrAlias marked this conversation as resolved.
Show resolved Hide resolved

### Changed

Expand Down
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