package
Version:
v0.0.0-...-e059a18
Opens a new window with list of versions in this module.
Published: Sep 25, 2023
License: 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 可以使用自定义的New()来初始化相关类。
New 函数返回接口时就是简单工厂模式,也是golang一般推荐做法。
simplefactory包中只有Mouth接口和New()函数可见。
Documentation
¶
Mouth is interface that people can Say words
func New(t schoolmember) Mouth
New return instance object that have `Mouth` and can speak
Source Files
¶
Click to show internal directories.
Click to hide internal directories.