golang function alias on method receiver

后端 未结 3 887
没有蜡笔的小新
没有蜡笔的小新 2020-12-01 13:23

I can create method alias for an usual method:

func method1() {
    fmt.Println(\"method1\")
}

var Method1 = method1

But cannot do the sam

3条回答
  •  半阙折子戏
    2020-12-01 13:52

    This is called method expression var MethodReceiver = (*Person).methodReceiver

    Playground

提交回复
热议问题