doude4924 2017-05-27 06:57
浏览 205
已采纳

如何定义适合Golang中任何函数的函数类型

I just want to define a function type which will match all functions and I have tried this:

type funcType func(...interface{}) ...interface{} but failed

How can I do this?

  • 写回答

1条回答 默认 最新

  • douchen4915 2017-05-27 07:02
    关注

    There is no function type that's compatible with any function.

    The best you can do is interface{} to which any value is assignable to, including functions.

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?