package
Version:
v0.0.0-...-eb36113
Opens a new window with list of versions in this module.
Published: May 19, 2023
License: Apache-2.0, MIT
Opens a new window with license information.
Imports: 1
Opens a new window with list of imports.
Imported by: 0
Opens a new window with list of known importers.
README
¶
简单工厂模式
go 语言没有构造函数一说,所以一般会定义NewXXX函数来初始化相关类。
NewXXX 函数返回接口时就是简单工厂模式,也就是说Golang的一般推荐做法就是简单工厂。
在这个 simplefactory 包中只有API 接口和NewAPI函数为包外可见,封装了实现细节。
Documentation
¶
Source Files
¶
Click to show internal directories.
Click to hide internal directories.