From c93ce7bece61fa758124f1c88e9cb8b4f55aec2f Mon Sep 17 00:00:00 2001 From: Miguel Elias dos Santos Date: Wed, 25 Jan 2023 09:47:33 +1100 Subject: [PATCH] Add JSON tag for ErrorResponse --- github/github.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/github/github.go b/github/github.go index e97e31f2f5d..309a8e862ef 100644 --- a/github/github.go +++ b/github/github.go @@ -841,9 +841,9 @@ An ErrorResponse reports one or more errors caused by an API request. GitHub API docs: https://docs.github.com/en/rest/#client-errors */ type ErrorResponse struct { - Response *http.Response // HTTP response that caused this error - Message string `json:"message"` // error message - Errors []Error `json:"errors"` // more detail on individual errors + Response *http.Response `json:"omitempty"` // HTTP response that caused this error + Message string `json:"message"` // error message + Errors []Error `json:"errors"` // more detail on individual errors // Block is only populated on certain types of errors such as code 451. Block *ErrorBlock `json:"block,omitempty"` // Most errors will also include a documentation_url field pointing