code: func (enc *Encoder) encodeInterface(v reflect.Value) (err error) {
  	if v.IsNil() || !v.CanInterface() {
  		msg := fmt.Sprintf("can't encode nil interface")
  		err = marshalError("encodeInterface", ErrNilInterface, msg, nil)
  		return err
  	}
  
  	// Extract underlying value from the interface and indirect through pointers.
  	ve := reflect.ValueOf(v.Interface())
  	ve = enc.indirect(ve)
  	return enc.encode(ve)
  }
docs: // encodeInterface examines the interface represented by the passed reflection
  // value to detect whether it is an interface that can be encoded if it is,
  // extracts the underlying value to pass back into the encode function for
  // encoding according to its type.
  //
  // A MarshalError is returned if any issues are encountered while encoding
  // the interface.