- 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.
推薦閱讀
- Data Visualization with D3 4.x Cookbook(Second Edition)
- Oracle Exadata性能優化
- 樂學Web編程:網站制作不神秘
- Mastering Business Intelligence with MicroStrategy
- Tableau 10 Bootcamp
- 區塊鏈技術進階與實戰(第2版)
- Emotional Intelligence for IT Professionals
- C++ System Programming Cookbook
- Node.js從入門到精通
- Qt 4開發實踐
- Apache Solr PHP Integration
- 零基礎學SQL(升級版)
- Python Linux系統管理與自動化運維
- Spring Boot從入門到實戰
- ASP.NET本質論