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
Labels
FrozenDueToAge NeedsFix The path to resolution is known, but the work has not been done.

Comments

@martisch
Copy link
Contributor

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 The path to resolution is known, but the work has not been done. 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

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

@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.
Labels
FrozenDueToAge NeedsFix The path to resolution is known, but the work has not been done.
Projects
None yet
Development

No branches or pull requests

2 participants