mirror of
https://github.com/golang/go
synced 2024-11-21 22:24:40 -07:00
fix a comment
This commit is contained in:
parent
7dd9c40f28
commit
049782dd4c
@ -384,7 +384,8 @@ var (
|
|||||||
|
|
||||||
// newTypeEncoder constructs an encoderFunc for a type.
|
// newTypeEncoder constructs an encoderFunc for a type.
|
||||||
// The returned encoder only checks CanAddr when allowAddr is true.
|
// The returned encoder only checks CanAddr when allowAddr is true.
|
||||||
func newTypeEncoder(t reflect.Type, allowAddr bool) encoderFunc { // If we have a non-pointer value whose type implements
|
func newTypeEncoder(t reflect.Type, allowAddr bool) encoderFunc {
|
||||||
|
// If we have a non-pointer value whose type implements
|
||||||
// Marshaler with a value receiver, then we're better off taking
|
// Marshaler with a value receiver, then we're better off taking
|
||||||
// the address of the value - otherwise we end up with an
|
// the address of the value - otherwise we end up with an
|
||||||
// allocation as we cast the value to an interface.
|
// allocation as we cast the value to an interface.
|
||||||
|
Loading…
Reference in New Issue
Block a user