Couple small bug fixes
diff --git a/utils/utils.go b/utils/utils.go
index 7e2bf7c..6e4d65d 100644
--- a/utils/utils.go
+++ b/utils/utils.go
@@ -90,7 +90,7 @@
}
for i := 0; i < int(availability.GetSpotsOpen()); i++ {
- // This deterministic which is fine given that we just want to get a mix of ticket types.
+ // This is deterministic which is fine given that we just want to get a mix of ticket types.
ticketTypeIndex := rand.Intn(len(tickets))
// Calculate price of line item.
if lineItem.GetPrice().GetCurrencyCode() == "" && tickets[ticketTypeIndex].GetPrice().GetCurrencyCode() != "" {
@@ -121,8 +121,7 @@
merchantServiceID := merchantService(service.GetMerchantId(), service.GetServiceId())
for _, ticket := range service.GetTicketType() {
// TicketType can't have an empty price message or ticket_type_id. If it does it's excluded from map.
- diff := cmp.Diff(&fpb.Price{}, ticket.GetPrice(), cmp.Comparer(proto.Equal))
- if len(ticket.GetTicketTypeId()) == 0 || diff == "" {
+ if ticket.GetPrice() == nil || len(ticket.GetTicketTypeId()) == 0 || cmp.Diff(fpb.Price{}, *ticket.GetPrice(), cmp.Comparer(proto.Equal)) == "" {
continue
}