From 84f5dbcb797fa73d29b62944fa057ebdf4bdc246 Mon Sep 17 00:00:00 2001 From: minherz Date: Thu, 14 Sep 2023 08:39:06 -0700 Subject: [PATCH] chore: refactoring comments fix typo in the comment. expand the comment about error context autopopulation. address lint warning for errors.New() call. --- errorreporting/errorreporting_quickstart/main.go | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/errorreporting/errorreporting_quickstart/main.go b/errorreporting/errorreporting_quickstart/main.go index e71ccf9110..af2a6eb838 100644 --- a/errorreporting/errorreporting_quickstart/main.go +++ b/errorreporting/errorreporting_quickstart/main.go @@ -44,7 +44,7 @@ func main() { ServiceName: "errorreporting_quickstart", ServiceVersion: "0.0.0", OnError: func(err error) { - log.Printf("Could not repport the error: %v", err) + log.Printf("Could not report the error: %v", err) }, }) if err != nil { @@ -52,7 +52,7 @@ func main() { } defer errorClient.Close() - err = errors.New("Something went wrong") + err = errors.New("something went wrong") if err != nil { logAndPrintError(err) return @@ -60,7 +60,8 @@ func main() { } func logAndPrintError(err error) { - // error context is autopopulated + /// Client autopopulates the error context of the error. For more details about the context see: + /// https://cloud.google.com/error-reporting/reference/rest/v1beta1/ErrorContext errorClient.Report(errorreporting.Entry{ Error: err, })