//
pkg.gl
Category
github.com/ExerciseCoding/template
internal
bean
option
package
1.0.4
Repository:
https://github.com/exercisecoding/template.git
Documentation:
pkg.go.dev
Overview
Versions
1
Dependencies
0
Dependents
0
Files
15 SLOC
#
Functions
Apply
Apply 将 opts 应用在 t 之上.
ApplyErr
ApplyErr 形如 Apply,它将 opts 应用在 t 之上, 如果 opts 中任何一个返回 error,那么它会中断并且返回 error.
#
Type aliases
Option
Option 是用于 Option 模式的泛型设计, 避免在代码中定义很多类似这样的结构体 一般情况下 T 应该是一个结构体.
OptionErr
OptionErr 形如 Option,但是会返回一个 error 你应该优先使用 Option,除非你在设计 option 模式的时候需要进行一些校验.