标签: first-class-function
与该标签相关的所有文章 "first-class-function".
-
Go 基础:interface 与 first-class function 如何消解 GoF 模式
Go 没有继承、没有 abstract class,用隐式 interface + first-class function + channel 替代了 GoF 23 个模式中的绝大多数。真正需要手写的模式只有 Functional Options、Middleware Chain 和 Decorator 堆叠,其余要么是语言内置(Iterator = range,Singleton = sync.Once),要么是 Java 遗产在 Go 里直接不需要。