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: too large index breaks later indices #6434

Closed
philpennock opened this issue Sep 20, 2013 · 3 comments
Closed

fmt: too large index breaks later indices #6434

philpennock opened this issue Sep 20, 2013 · 3 comments
Assignees
Milestone

Comments

@philpennock
Copy link

@philpennock philpennock commented Sep 20, 2013

go tip (just after the 1.2 RC):

What steps will reproduce the problem?
Code (not in play because uses tip/1.2RC feature):

    package main
    import "fmt"
    func main() { fmt.Printf("%[3]s %[1]s %s\n", "woo", "world!") }

What is the expected output?

    %!s(BADINDEX) woo world!

What do you see instead?

    %!s(BADINDEX) %!s(BADINDEX) %!s(BADINDEX)

Which compiler are you using (5g, 6g, 8g, gccgo)?

6g

Which operating system are you using?

Darwin/amd64 (MacOS 10.8.5)

Which version are you using?  (run 'go version')

go version devel +ebd02fba267b Fri Sep 20 09:40:56 2013 -0700 darwin/amd64

Please provide any additional information below.

The badindex means that this might be deemed as "buggy code", but I think it
*should* have handled the subsequent _good_ index and only shown the BADINDEX for the
first %[indexed]s parameter.
@ianlancetaylor
Copy link
Contributor

@ianlancetaylor ianlancetaylor commented Sep 20, 2013

Comment 1:

Labels changed: added go1.2maybe.

Owner changed to @robpike.

@robpike
Copy link
Contributor

@robpike robpike commented Sep 23, 2013

Comment 2:

Tip: you can put the code in play even if it doesn't run.

Status changed to Started.

@robpike
Copy link
Contributor

@robpike robpike commented Sep 23, 2013

Comment 3:

This issue was closed by revision 3e3ed5d.

Status changed to Fixed.

@rsc rsc added this to the Go1.2 milestone Apr 14, 2015
@rsc rsc removed the go1.2maybe label Apr 14, 2015
@golang golang locked and limited conversation to collaborators Jun 25, 2016
This issue was closed.
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
5 participants
You can’t perform that action at this time.