A new method of in situ electrically induced self-assembly technology combined with electrochemical deposition has been developed for the controllable preparation of organic/inorganic core/shell semiconductor heterojunction nanowire arrays. The size of the interface of the heterojunction nanowire can be tuned by the growing parameter. The heterojunction nanowires of graphdiyne/CuS with core/shell structure showed the strong dependence of rectification ratio and perfect diode performance on the size of the interface. It will be a new way for controlling the structures and properties of one-dimensional heterojunction nanomaterials.