From 1e84b1d79d9f3907716899bd694010ca0a9249a5 Mon Sep 17 00:00:00 2001 From: Bryant Luk Date: Sat, 1 Dec 2018 14:25:45 -0600 Subject: [PATCH] Fix missing err short assignment in Go Metrics --- content/quickstart/go/metrics.md | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/content/quickstart/go/metrics.md b/content/quickstart/go/metrics.md index de0dc288..58160f3b 100644 --- a/content/quickstart/go/metrics.md +++ b/content/quickstart/go/metrics.md @@ -410,7 +410,7 @@ and for complete usage: {{% tabs Snippet All %}} ```go func readEvaluateProcess(br *bufio.Reader) (terr error) { - ctx, _ := tag.New(context.Background(), tag.Insert(KeyMethod, "repl"), tag.Insert(KeyStatus, "OK")) + ctx, err := tag.New(context.Background(), tag.Insert(KeyMethod, "repl"), tag.Insert(KeyStatus, "OK")) if err != nil { return err } @@ -481,7 +481,7 @@ func main() { // readEvaluateProcess reads a line from the input reader and // then processes it. It returns an error if any was encountered. func readEvaluateProcess(br *bufio.Reader) (terr error) { - ctx, _ := tag.New(context.Background(), tag.Insert(KeyMethod, "repl"), tag.Insert(KeyStatus, "OK")) + ctx, err := tag.New(context.Background(), tag.Insert(KeyMethod, "repl"), tag.Insert(KeyStatus, "OK")) if err != nil { return err } @@ -603,7 +603,7 @@ Now we will record the desired metrics. To do so, we will use `stats.Record` and {{% tabs Snippet All %}} ```go func readEvaluateProcess(br *bufio.Reader) (terr error) { - ctx, _ := tag.New(context.Background(), tag.Insert(KeyMethod, "repl"), tag.Insert(KeyStatus, "OK")) + ctx, err := tag.New(context.Background(), tag.Insert(KeyMethod, "repl"), tag.Insert(KeyStatus, "OK")) if err != nil { return err } @@ -702,7 +702,7 @@ func main() { // readEvaluateProcess reads a line from the input reader and // then processes it. It returns an error if any was encountered. func readEvaluateProcess(br *bufio.Reader) (terr error) { - ctx, _ := tag.New(context.Background(), tag.Insert(KeyMethod, "repl"), tag.Insert(KeyStatus, "OK")) + ctx, err := tag.New(context.Background(), tag.Insert(KeyMethod, "repl"), tag.Insert(KeyStatus, "OK")) if err != nil { return err } @@ -826,7 +826,7 @@ func main() { // readEvaluateProcess reads a line from the input reader and // then processes it. It returns an error if any was encountered. func readEvaluateProcess(br *bufio.Reader) (terr error) { - ctx, _ := tag.New(context.Background(), tag.Insert(KeyMethod, "repl"), tag.Insert(KeyStatus, "OK")) + ctx, err := tag.New(context.Background(), tag.Insert(KeyMethod, "repl"), tag.Insert(KeyStatus, "OK")) if err != nil { return err } @@ -987,7 +987,7 @@ func main() { // readEvaluateProcess reads a line from the input reader and // then processes it. It returns an error if any was encountered. func readEvaluateProcess(br *bufio.Reader) (terr error) { - ctx, _ := tag.New(context.Background(), tag.Insert(KeyMethod, "repl"), tag.Insert(KeyStatus, "OK")) + ctx, err := tag.New(context.Background(), tag.Insert(KeyMethod, "repl"), tag.Insert(KeyStatus, "OK")) if err != nil { return err } @@ -1148,7 +1148,7 @@ func main() { // readEvaluateProcess reads a line from the input reader and // then processes it. It returns an error if any was encountered. func readEvaluateProcess(br *bufio.Reader) (terr error) { - ctx, _ := tag.New(context.Background(), tag.Insert(KeyMethod, "repl"), tag.Insert(KeyStatus, "OK")) + ctx, err := tag.New(context.Background(), tag.Insert(KeyMethod, "repl"), tag.Insert(KeyStatus, "OK")) if err != nil { return err } @@ -1373,7 +1373,7 @@ func main() { // readEvaluateProcess reads a line from the input reader and // then processes it. It returns an error if any was encountered. func readEvaluateProcess(br *bufio.Reader) (terr error) { - ctx, _ := tag.New(context.Background(), tag.Insert(KeyMethod, "repl"), tag.Insert(KeyStatus, "OK")) + ctx, err := tag.New(context.Background(), tag.Insert(KeyMethod, "repl"), tag.Insert(KeyStatus, "OK")) if err != nil { return err }