Skip to content

Commit

Permalink
Clean up code
Browse files Browse the repository at this point in the history
  • Loading branch information
alinz committed May 20, 2024
1 parent 65e9146 commit 26821a0
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions request_reply_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,9 @@ func TestRequestReply(t *testing.T) {
Result int
}

bus.Reply(context.TODO(), client, "func.div", func(ctx context.Context, in json.RawMessage) (resp any, err error) {
subject := "func.div"

bus.Reply(context.TODO(), client, subject, func(ctx context.Context, in json.RawMessage) (resp any, err error) {
req := &Req{}
err = json.Unmarshal(in, req)
if err != nil {
Expand All @@ -36,7 +38,7 @@ func TestRequestReply(t *testing.T) {
return &Resp{Result: req.A / req.B}, nil
})

fn := bus.Request(client, "func.div")
fn := bus.Request(client, subject)

req := &Req{A: 4, B: 2}
resp := &Resp{}
Expand Down

0 comments on commit 26821a0

Please sign in to comment.