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: catchPanic should not clear fmtFlags permanently #18282

Closed
martisch opened this issue Dec 11, 2016 · 1 comment
Closed

fmt: catchPanic should not clear fmtFlags permanently #18282

martisch opened this issue Dec 11, 2016 · 1 comment
Assignees

Comments

@martisch
Copy link
Contributor

@martisch martisch commented Dec 11, 2016

on (at least) go1.4, go1.7 and go tip:

https://play.golang.org/p/5vHSWdbgX_

package main

import (
	"fmt"
)

type PanicGo struct {
	message interface{}
}

func (p PanicGo) GoString() string {
	panic(p.message)
}

func main() {
	fmt.Printf("%#v\n",[]interface{}{PanicGo{3}, PanicGo{3}})
}

What did you expect to see?

[]interface {}{%!v(PANIC=3), %!v(PANIC=3)}

What did you see instead?

[]interface {}{%!v(PANIC=3), {3}}

Submitting a CL that fixes this in a few minutes.

@martisch martisch added the NeedsFix label Dec 11, 2016
@martisch martisch self-assigned this Dec 11, 2016
@martisch martisch changed the title fmt: undo clearflags in catchPanic after error messsage has been printed fmt: catchPanic should not clear fmtFlags permanently Dec 11, 2016
@gopherbot
Copy link

@gopherbot gopherbot commented Dec 11, 2016

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

@gopherbot gopherbot closed this in cbcc1db Dec 11, 2016
@golang golang locked and limited conversation to collaborators Dec 11, 2017
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
2 participants
You can’t perform that action at this time.