瀏覽代碼

Add comment for UnmarshalJSON

Carson Hoffman 3 年之前
父節點
當前提交
bd34c3c66d
共有 1 個文件被更改,包括 2 次插入0 次删除
  1. 2 0
      structs.go

+ 2 - 0
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"`