From 51148b6485bf66f1a709b488f3338d19afc4063c Mon Sep 17 00:00:00 2001 From: resi-commits Date: Sat, 2 Dec 2023 01:49:17 +0100 Subject: [PATCH] feat: add relative_time_description property to PlaceReview (#273) * feat: add relative_time_description property to PlaceReview * add relativeTimeDescription to TestPlaceDetails * chore: update places_test.go Reverting to simplified test data committed after this PR was created. --------- Co-authored-by: Angela Yu <5506675+wangela@users.noreply.github.com> --- places.go | 3 +++ places_test.go | 4 ++-- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/places.go b/places.go index 5f867f4..1ce9adf 100644 --- a/places.go +++ b/places.go @@ -599,6 +599,9 @@ type PlaceReview struct { // Rating the user's overall rating for this place. This is a whole number, ranging // from 1 to 5. Rating int `json:"rating,omitempty"` + // RelativeTimeDescription the time that the review was submitted in text, relative + // to the current time. + RelativeTimeDescription string `json:"relative_time_description,omitempty"` // Text is the user's review. When reviewing a location with Google Places, text // reviews are considered optional. Therefore, this field may by empty. Note that // this field may include simple HTML markup. diff --git a/places_test.go b/places_test.go index 469671a..cd9df28 100644 --- a/places_test.go +++ b/places_test.go @@ -727,7 +727,7 @@ func TestPlaceDetails(t *testing.T) { "Sunday: 12:00 – 8:45 PM" ] }, - "secondary_opening_hours": [ + "secondary_opening_hours": [ { "open_now": true, "periods": [ @@ -852,7 +852,7 @@ func TestPlaceDetails(t *testing.T) { if placeID != resp.PlaceID { t.Errorf("expected %+v, was %+v", placeID, resp.PlaceID) } - + if !*&resp.ServesDinner { t.Errorf("Expected ServesDinner to be true") }