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

fmt: scanf behaviour inconsistent with doc specification #10862

Closed
syst3mw0rm opened this issue May 15, 2015 · 4 comments
Closed

fmt: scanf behaviour inconsistent with doc specification #10862

syst3mw0rm opened this issue May 15, 2015 · 4 comments
Assignees
Milestone

Comments

@syst3mw0rm
Copy link
Contributor

@syst3mw0rm syst3mw0rm commented May 15, 2015

fmt doc says: Scanf, Fscanf and Sscanf require newlines in the input to match newlines in the format; the other routines treat newlines as spaces.

The following program spits out error (should not according to doc):

package main

import (
    "fmt"
    "log"
)

func main() {
    var a, b int
    _, err := fmt.Sscanf("1\n2", "%d %d", &a, &b)
    if err == nil {
        log.Fatalf("got - %q, expected - %q", err, "unexpected newline")
    }
}

on commit 335e44d

@ianlancetaylor ianlancetaylor added this to the Go1.5 milestone May 15, 2015
@robpike
Copy link
Contributor

@robpike robpike commented Jun 5, 2015

Duplicate of #9459

@robpike robpike closed this Jun 5, 2015
@robpike
Copy link
Contributor

@robpike robpike commented Jun 5, 2015

Not a duplicate of #9459, sorry. This is a different issue; fix out for review in https://go-review.googlesource.com/10779

@robpike robpike reopened this Jun 5, 2015
@gopherbot
Copy link

@gopherbot gopherbot commented Jun 5, 2015

CL https://golang.org/cl/10779 mentions this issue.

@gopherbot
Copy link

@gopherbot gopherbot commented Jun 12, 2015

CL https://golang.org/cl/10991 mentions this issue.

@robpike robpike closed this in 57f4b43 Jun 12, 2015
@golang golang locked and limited conversation to collaborators Jun 25, 2016
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
4 participants
You can’t perform that action at this time.