- 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.
推薦閱讀
- Android Wearable Programming
- ClickHouse性能之巔:從架構設計解讀性能之謎
- DBA攻堅指南:左手Oracle,右手MySQL
- 解構產品經理:互聯網產品策劃入門寶典
- Learning Spring 5.0
- 高效微控制器C語言編程
- Java持續交付
- OpenStack Orchestration
- 零基礎入門學習Python(第2版)
- Mastering C++ Multithreading
- Zabbix Performance Tuning
- WordPress Search Engine Optimization(Second Edition)
- MongoDB Cookbook
- CryENGINE Game Programming with C++,C#,and Lua
- C/C++代碼調試的藝術