From ebbe50dc85a63fe4f8a61605e5f55d53af4750ea Mon Sep 17 00:00:00 2001 From: Wes Date: Wed, 25 Oct 2023 13:58:10 -0700 Subject: [PATCH] fix: since we don't support optionals return empty array (#519) This fixes and issue with the online_boutique sample app crashing on a `null` array --------- Co-authored-by: github-actions[bot] --- examples/online-boutique/services/cart/store.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/online-boutique/services/cart/store.go b/examples/online-boutique/services/cart/store.go index 536ec527c0..702807a05d 100644 --- a/examples/online-boutique/services/cart/store.go +++ b/examples/online-boutique/services/cart/store.go @@ -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)