Return empty arrays rather than null
This commit is contained in:
@@ -17,6 +17,7 @@ type FreshRestaurant struct {
|
||||
|
||||
func MakeFreshRestaurant(url string, name string) FreshRestaurant {
|
||||
restaurant := FreshRestaurant{}
|
||||
restaurant.SetDefaultValues()
|
||||
restaurant.url = url
|
||||
restaurant.name = name
|
||||
return restaurant
|
||||
@@ -24,6 +25,7 @@ func MakeFreshRestaurant(url string, name string) FreshRestaurant {
|
||||
|
||||
func NewFreshRestaurant(url string, name string) *FreshRestaurant {
|
||||
restaurant := new(FreshRestaurant)
|
||||
restaurant.SetDefaultValues()
|
||||
restaurant.url = url
|
||||
restaurant.name = name
|
||||
return restaurant
|
||||
|
||||
Reference in New Issue
Block a user