code: func makeWriter(typ reflect.Type, ts tags) (writer, error) {
  	kind := typ.Kind()
  	switch {
  	case typ == rawValueType:
  		return writeRawValue, nil
  	case typ.Implements(encoderInterface):
  		return writeEncoder, nil
  	case kind != reflect.Ptr && reflect.PtrTo(typ).Implements(encoderInterface):
  		return writeEncoderNoPtr, nil
  	case kind == reflect.Interface:
  		return writeInterface, nil
  	case typ.AssignableTo(reflect.PtrTo(bigInt)):
  		return writeBigIntPtr, nil
  	case typ.AssignableTo(bigInt):
  		return writeBigIntNoPtr, nil
  	case isUint(kind):
  		return writeUint, nil
  	case kind == reflect.Bool:
  		return writeBool, nil
  	case kind == reflect.String:
  		return writeString, nil
  	case kind == reflect.Slice && isByte(typ.Elem()):
  		return writeBytes, nil
  	case kind == reflect.Array && isByte(typ.Elem()):
  		return writeByteArray, nil
  	case kind == reflect.Slice || kind == reflect.Array:
  		return makeSliceWriter(typ, ts)
  	case kind == reflect.Struct:
  		return makeStructWriter(typ)
  	case kind == reflect.Ptr:
  		return makePtrWriter(typ)
  	default:
  		return nil, fmt.Errorf("rlp: type %v is not RLP-serializable", typ)
  	}
  }
docs: // makeWriter creates a writer function for the given type.