Skip to content

Commit 156a437

Browse files
author
biwentao
committed
fix: wrap
1 parent 4c03513 commit 156a437

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

20_decorator/decorator.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ type MulDecorator struct {
1515
num int
1616
}
1717

18-
func WarpMulDecorator(c Component, num int) Component {
18+
func WrapMulDecorator(c Component, num int) Component {
1919
return &MulDecorator{
2020
Component: c,
2121
num: num,
@@ -31,7 +31,7 @@ type AddDecorator struct {
3131
num int
3232
}
3333

34-
func WarpAddDecorator(c Component, num int) Component {
34+
func WrapAddDecorator(c Component, num int) Component {
3535
return &AddDecorator{
3636
Component: c,
3737
num: num,

20_decorator/decorator_test.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@ import "fmt"
44

55
func ExampleDecorator() {
66
var c Component = &ConcreteComponent{}
7-
c = WarpAddDecorator(c, 10)
8-
c = WarpMulDecorator(c, 8)
7+
c = WrapAddDecorator(c, 10)
8+
c = WrapMulDecorator(c, 8)
99
res := c.Calc()
1010

1111
fmt.Printf("res %d\n", res)

0 commit comments

Comments
 (0)