-
Notifications
You must be signed in to change notification settings - Fork 18k
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: define what %p means (or doesn't mean) on interfaces #16314
Labels
Milestone
Comments
It's well-defined. The fmt package docs say: "Regardless of the verb, if an operand is an interface value, the internal concrete value is used, not the interface itself." This is a bug in vet, and I already have a fix in my tree for it as part of fixing #11041. |
josharian
added a commit
to josharian/go
that referenced
this issue
Jul 13, 2016
fmt treats interfaces as being transparent. As a result, we cannot say with confidence that any particular verb is wrong. This fixes the following vet false positives in the standard library: database/sql/sql_test.go:210: arg dep for printf verb %p of wrong type: sql.finalCloser fmt/fmt_test.go:1663: arg nil for printf verb %s of wrong type: untyped nil go/ast/commentmap.go:328: arg node for printf verb %p of wrong type: ast.Node net/http/transport_test.go:120: arg c for printf verb %p of wrong type: net.Conn net/http/httptest/server.go:198: arg c for printf verb %p of wrong type: net.Conn net/http/httputil/dump_test.go:258: arg body for printf verb %p of wrong type: io.Reader reflect/set_test.go:81: arg x for printf verb %p of wrong type: io.Writer reflect/set_test.go:141: arg bb for printf verb %p of wrong type: io.Reader Updates golang#11041 Updates golang#16314 Change-Id: I76df01abb3c34a97b6960f551bed9c1c91377cfc
josharian
added a commit
to josharian/go
that referenced
this issue
Jul 14, 2016
fmt treats interfaces as being transparent. As a result, we cannot say with confidence that any particular verb is wrong. This fixes the following vet false positives in the standard library: database/sql/sql_test.go:210: arg dep for printf verb %p of wrong type: sql.finalCloser fmt/fmt_test.go:1663: arg nil for printf verb %s of wrong type: untyped nil go/ast/commentmap.go:328: arg node for printf verb %p of wrong type: ast.Node net/http/transport_test.go:120: arg c for printf verb %p of wrong type: net.Conn net/http/httptest/server.go:198: arg c for printf verb %p of wrong type: net.Conn net/http/httputil/dump_test.go:258: arg body for printf verb %p of wrong type: io.Reader reflect/set_test.go:81: arg x for printf verb %p of wrong type: io.Writer reflect/set_test.go:141: arg bb for printf verb %p of wrong type: io.Reader Updates golang#11041 Updates golang#16314 Change-Id: I76df01abb3c34a97b6960f551bed9c1c91377cfc
josharian
added a commit
to josharian/go
that referenced
this issue
Jul 21, 2016
fmt treats interfaces as being transparent. As a result, we cannot say with confidence that any particular verb is wrong. This fixes the following vet false positives in the standard library: database/sql/sql_test.go:210: arg dep for printf verb %p of wrong type: sql.finalCloser fmt/fmt_test.go:1663: arg nil for printf verb %s of wrong type: untyped nil go/ast/commentmap.go:328: arg node for printf verb %p of wrong type: ast.Node net/http/transport_test.go:120: arg c for printf verb %p of wrong type: net.Conn net/http/httptest/server.go:198: arg c for printf verb %p of wrong type: net.Conn net/http/httputil/dump_test.go:258: arg body for printf verb %p of wrong type: io.Reader reflect/set_test.go:81: arg x for printf verb %p of wrong type: io.Writer reflect/set_test.go:141: arg bb for printf verb %p of wrong type: io.Reader Updates golang#11041 Updates golang#16314 Change-Id: I76df01abb3c34a97b6960f551bed9c1c91377cfc
CL https://golang.org/cl/27127 mentions this issue. |
gopherbot
pushed a commit
that referenced
this issue
Aug 18, 2016
fmt treats interfaces as being transparent. As a result, we cannot say with confidence that any particular verb is wrong. This fixes the following vet false positives in the standard library: database/sql/sql_test.go:210: arg dep for printf verb %p of wrong type: sql.finalCloser fmt/fmt_test.go:1663: arg nil for printf verb %s of wrong type: untyped nil go/ast/commentmap.go:328: arg node for printf verb %p of wrong type: ast.Node net/http/transport_test.go:120: arg c for printf verb %p of wrong type: net.Conn net/http/httptest/server.go:198: arg c for printf verb %p of wrong type: net.Conn net/http/httputil/dump_test.go:258: arg body for printf verb %p of wrong type: io.Reader reflect/set_test.go:81: arg x for printf verb %p of wrong type: io.Writer reflect/set_test.go:141: arg bb for printf verb %p of wrong type: io.Reader Updates #11041 Updates #16314 Change-Id: I76df01abb3c34a97b6960f551bed9c1c91377cfc Reviewed-on: https://go-review.googlesource.com/27127 Run-TryBot: Josh Bleecher Snyder <josharian@gmail.com> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Rob Pike <r@golang.org>
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
(split from #16230 (comment))
What does %p mean in the
fmt
package for interface values?It seems to do something, but the documentation says nothing.
/cc @josharian @robpike
The text was updated successfully, but these errors were encountered: