mirror of
https://github.com/crazybber/go-pattern-examples.git
synced 2025-04-04 13:43:34 +03:00
regular structure patterns order and names
This commit is contained in:
parent
6722c9ba1c
commit
06412a32fe
9 changed files with 1 additions and 0 deletions
|
@ -53,6 +53,7 @@ func Introduce(name string, setters ...Option /*传入闭包设置函数*/) {
|
|||
Company: "",
|
||||
Gender: true,
|
||||
}
|
||||
//模式的重点体现在这里,通过外部传入的闭包函数设置内在变量
|
||||
for _, setter := range setters {
|
||||
setter(args)
|
||||
}
|
Loading…
Add table
Reference in a new issue