官术网_书友最值得收藏!

  • Go Systems Programming
  • Mihalis Tsoukalos
  • 129字
  • 2021-07-02 18:07:58

Anonymous functions

Anonymous functions can be defined in line, without the need for a name, and they are usually used for implementing things that require a small amount of code. In Go, a function can return an anonymous function or take an anonymous function as one of its arguments. Additionally, anonymous functions can be attached to Go variables.

It is considered a good practice for anonymous functions to have a small implementation and local usage. If an anonymous function does not have local utilization, then you might need to consider making it a regular function.

When an anonymous function is suitable for a job, then it is extremely convenient and makes your life easier; just do not use too many anonymous functions in your programs without a good reason.

主站蜘蛛池模板: 芦山县| 元谋县| 蒲城县| 当阳市| 开封县| 白河县| 罗田县| 徐水县| 旺苍县| 扎赉特旗| 景东| 颍上县| 丹东市| 连云港市| 江油市| 前郭尔| 延长县| 靖边县| 临猗县| 香河县| 遵义县| 葵青区| 博客| 清镇市| 石门县| 陆川县| 琼海市| 新安县| 黑龙江省| 九江市| 海林市| 松潘县| 镇江市| 安义县| 内丘县| 曲阳县| 太康县| 集安市| 旬邑县| 桂东县| 湟源县|