Skip to content

Commit

Permalink
fix: wrap
Browse files Browse the repository at this point in the history
  • Loading branch information
biwentao committed Sep 27, 2022
1 parent 4c03513 commit 156a437
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions 20_decorator/decorator.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ type MulDecorator struct {
num int
}

func WarpMulDecorator(c Component, num int) Component {
func WrapMulDecorator(c Component, num int) Component {
return &MulDecorator{
Component: c,
num: num,
Expand All @@ -31,7 +31,7 @@ type AddDecorator struct {
num int
}

func WarpAddDecorator(c Component, num int) Component {
func WrapAddDecorator(c Component, num int) Component {
return &AddDecorator{
Component: c,
num: num,
Expand Down
4 changes: 2 additions & 2 deletions 20_decorator/decorator_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ import "fmt"

func ExampleDecorator() {
var c Component = &ConcreteComponent{}
c = WarpAddDecorator(c, 10)
c = WarpMulDecorator(c, 8)
c = WrapAddDecorator(c, 10)
c = WrapMulDecorator(c, 8)
res := c.Calc()

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

0 comments on commit 156a437

Please sign in to comment.