Skip to content

Commit

Permalink
Update nil comment
Browse files Browse the repository at this point in the history
  • Loading branch information
abhinav committed Jun 10, 2016
1 parent 62e96e6 commit dee433d
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions crossdock/client/ctxpropagation/behavior.go
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,10 @@ type handler interface {
func assertBaggageMatches(t crossdock.T, ctx context.Context, want transport.Headers) bool {
assert := crossdock.Assert(t)
got := baggage.FromContext(ctx)
if len(want) == 0 { // nils
return assert.Len(got, 0, "baggage must be empty: %v", got)

if len(want) == 0 {
// len check to handle nil vs empty cases gracefully.
return assert.Empty(got, "baggage must be empty: %v", got)
}

return assert.Equal(want, got, "baggage must match")
Expand Down

0 comments on commit dee433d

Please sign in to comment.