Skip to content

Commit

Permalink
fix (payload) remove code smell
Browse files Browse the repository at this point in the history
  • Loading branch information
pentateu committed Aug 30, 2019
1 parent c9a016b commit 6401323
Showing 1 changed file with 2 additions and 8 deletions.
10 changes: 2 additions & 8 deletions payload/payload.go
Original file line number Diff line number Diff line change
Expand Up @@ -548,18 +548,12 @@ func Error(msgs ...interface{}) moleculer.Payload {
return New(errors.New(fmt.Sprint(msgs...)))
}

var emptyList = &RawPayload{}

func EmptyList() moleculer.Payload {
emptyList.source = []interface{}{}
return emptyList
return &RawPayload{source: []interface{}{}}
}

var emptyValue = &RawPayload{}

func Empty() moleculer.Payload {
emptyValue.source = map[string]interface{}{}
return emptyValue
return &RawPayload{source: map[string]interface{}{}}
}

func New(source interface{}) moleculer.Payload {
Expand Down

0 comments on commit 6401323

Please sign in to comment.