1
0
mirror of https://github.com/golang/go synced 2024-11-21 12:04:41 -07:00

fix a comment

This commit is contained in:
Dmitry Zenovich 2024-08-21 02:54:11 +03:00
parent 7dd9c40f28
commit 049782dd4c

View File

@ -384,7 +384,8 @@ var (
// newTypeEncoder constructs an encoderFunc for a type.
// 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
// the address of the value - otherwise we end up with an
// allocation as we cast the value to an interface.