No, there's no way to do that in Go. There is no preprocessor nor any other
way to obtain the original expression. You'll have to duplicate the
expression as part of your format string.

On Fri, Jul 22, 2016 at 6:57 AM Sam Whited <s...@samwhited.com> wrote:

> On Thu, Jul 21, 2016 at 7:09 PM, sque via golang-nuts
> <golang-nuts@googlegroups.com> wrote:
> > The "#x" is the really useful part that lets you print the original
> > expression. For example, if int a = 4 and int b = 10
>
> This is not exactly the same, but %#v is probably what you want:
>
> https://godoc.org/fmt#hdr-Printing
>
> —Sam
>
>
> --
> Sam Whited
> pub 4096R/54083AE104EA7AD3
>
> --
> You received this message because you are subscribed to the Google Groups
> "golang-nuts" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to golang-nuts+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google Groups 
"golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to golang-nuts+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to