Proposal Details

Add a Panicf function to the fmt package, similar to log.Panicf(). Currently to format a panic message, I would use:

panic(fmt.Sprintf("cannot represent token type %s as string", tok))

With fmt.Panicf, this could be rewritten as:

fmt.Panicf("cannot represent token type %s as string", tok)

log.Panicf() prints a timestamp before panicking, but I'm not interested in it.

Comment From: seankhliao

Panicf doesn't really fit into what fmt does. The original using Sprintf seems quite clear.

Comment From: gabyhelp

Related Issues

Related Documentation

(Emoji vote if this was helpful or unhelpful; more detailed feedback welcome in this discussion.)