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: Documentation for *scanf should mention whether short reads are errors. #8708

Closed
bcmills opened this issue Sep 11, 2014 · 2 comments
Closed
Assignees
Milestone

Comments

@bcmills
Copy link
Member

@bcmills bcmills commented Sep 11, 2014

The comment for fmt.Fscan says:

It returns the number of items successfully scanned. If that is less than the number of
arguments, err will report why.


But fmt.Fscanf only says:

It returns the number of items successfully parsed.


From reading the source, it seems that the formatted variants are also intended to
return a non-nil error for short scans:
http://play.golang.org/p/aS0XEsQLWp

If so, the documentation should be made consistent to reflect this.
@ianlancetaylor
Copy link
Contributor

@ianlancetaylor ianlancetaylor commented Sep 12, 2014

Comment 1:

Labels changed: added repo-main, release-none, documentation.

@bradfitz bradfitz removed the new label Dec 18, 2014
@robpike robpike self-assigned this Jan 6, 2015
@rsc rsc added this to the Unplanned milestone Apr 10, 2015
@rsc rsc removed release-none labels Apr 10, 2015
@gopherbot
Copy link

@gopherbot gopherbot commented May 5, 2015

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

@robpike robpike closed this in a63ba85 May 5, 2015
@mikioh mikioh modified the milestones: Go1.5, Unplanned May 15, 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
7 participants
You can’t perform that action at this time.