1
0
mirror of https://github.com/golang/go synced 2024-09-24 15:20:16 -06:00

runtime: fix string formatting

Change-Id: I87d0bc78a246e479d97b3f83cf77c1f701975413
GitHub-Last-Rev: 22cd684e08
GitHub-Pull-Request: golang/go#29157
Reviewed-on: https://go-review.googlesource.com/c/153298
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Emmanuel Odeke <emm.odeke@gmail.com>
Reviewed-by: Austin Clements <austin@google.com>
This commit is contained in:
Daniel Ingram 2018-12-22 22:11:25 +00:00 committed by Brad Fitzpatrick
parent 04eda1a94d
commit 8962b71c49

View File

@ -353,7 +353,8 @@ class IfacePrinter:
return "<bad dynamic type>"
if dtype is None: # trouble looking up, print something reasonable
return "({0}){0}".format(iface_dtype_name(self.val), self.val['data'])
return "({typename}){data}".format(
typename=iface_dtype_name(self.val), data=self.val['data'])
try:
return self.val['data'].cast(dtype).dereference()