add method to interface via reflect

89 views
Skip to first unread message

Vasiliy Tolstov

unread,
Sep 10, 2020, 6:44:29 PM9/10/20
to golan...@googlegroups.com
Hi! Does go support adding method to exiting interface via reflect?
Mostly I need to add method to struct pointer.

--
Vasiliy Tolstov,
e-mail: v.to...@selfip.ru

Kurtis Rader

unread,
Sep 10, 2020, 6:48:53 PM9/10/20
to Vasiliy Tolstov, golang-nuts
On Thu, Sep 10, 2020 at 3:44 PM Vasiliy Tolstov <v.to...@selfip.ru> wrote:
Hi! Does go support adding method to exiting interface via reflect?
Mostly I need to add method to struct pointer.

No, and this sounds like an XY problem. It would help if you described the problem rather than the solution.

--
Kurtis Rader
Caretaker of the exceptional canines Junior and Hank

tapi...@gmail.com

unread,
Sep 11, 2020, 11:46:06 PM9/11/20
to golang-nuts
What should happen after the method is added?
Will those types implementing the interface still implement it?
Reply all
Reply to author
Forward
0 new messages