From bd34c3c66dc65043e724aa797400ccb9c5973849 Mon Sep 17 00:00:00 2001 From: Carson Hoffman Date: Wed, 20 Jan 2021 19:43:00 -0500 Subject: [PATCH] Add comment for UnmarshalJSON --- structs.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/structs.go b/structs.go index 3267072..067bab2 100644 --- a/structs.go +++ b/structs.go @@ -817,6 +817,8 @@ type TooManyRequests struct { RetryAfter time.Duration `json:"retry_after"` } +// UnmarshalJSON helps support translation of a milliseconds-based float +// into a time.Duration on TooManyRequests. func (t *TooManyRequests) UnmarshalJSON(b []byte) error { u := struct { Bucket string `json:"bucket"`