Skip to content

Commit

Permalink
fix: since we don't support optionals return empty array (#519)
Browse files Browse the repository at this point in the history
This fixes and issue with the online_boutique sample app crashing on a
`null` array

---------

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
  • Loading branch information
wesbillman and github-actions[bot] authored Oct 25, 2023
1 parent 4485074 commit ebbe50d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion examples/online-boutique/services/cart/store.go
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ func (s *Store) Get(userID string) []Item {
defer s.lock.Unlock()
items, ok := s.carts.Get(userID)
if !ok {
return nil
return []Item{}
}
out := make([]Item, len(items))
copy(out, items)
Expand Down

0 comments on commit ebbe50d

Please sign in to comment.