Can functions be passed as parameters?

后端 未结 6 1059
北荒
北荒 2020-12-12 12:06

In Java I can do something like

derp(new Runnable { public void run () { /* run this sometime later */ } })

and \"run\" the code in the me

6条回答
  •  北海茫月
    2020-12-12 12:36

    Yes Go does accept first-class functions.

    See the article "First Class Functions in Go" for useful links.

提交回复
热议问题