Skip to content
This repository was archived by the owner on Oct 3, 2023. It is now read-only.

Commit 241c306

Browse files
blukEmmanuel T Odeke
authored and
Emmanuel T Odeke
committed
content/metrics/go: fix missing err short assignment in Go Metrics (#491)
1 parent db7a748 commit 241c306

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

content/quickstart/go/metrics.md

+8-8
Original file line numberDiff line numberDiff line change
@@ -410,7 +410,7 @@ and for complete usage:
410410
{{% tabs Snippet All %}}
411411
```go
412412
func readEvaluateProcess(br *bufio.Reader) (terr error) {
413-
ctx, _ := tag.New(context.Background(), tag.Insert(KeyMethod, "repl"), tag.Insert(KeyStatus, "OK"))
413+
ctx, err := tag.New(context.Background(), tag.Insert(KeyMethod, "repl"), tag.Insert(KeyStatus, "OK"))
414414
if err != nil {
415415
return err
416416
}
@@ -481,7 +481,7 @@ func main() {
481481
// readEvaluateProcess reads a line from the input reader and
482482
// then processes it. It returns an error if any was encountered.
483483
func readEvaluateProcess(br *bufio.Reader) (terr error) {
484-
ctx, _ := tag.New(context.Background(), tag.Insert(KeyMethod, "repl"), tag.Insert(KeyStatus, "OK"))
484+
ctx, err := tag.New(context.Background(), tag.Insert(KeyMethod, "repl"), tag.Insert(KeyStatus, "OK"))
485485
if err != nil {
486486
return err
487487
}
@@ -603,7 +603,7 @@ Now we will record the desired metrics. To do so, we will use `stats.Record` and
603603
{{% tabs Snippet All %}}
604604
```go
605605
func readEvaluateProcess(br *bufio.Reader) (terr error) {
606-
ctx, _ := tag.New(context.Background(), tag.Insert(KeyMethod, "repl"), tag.Insert(KeyStatus, "OK"))
606+
ctx, err := tag.New(context.Background(), tag.Insert(KeyMethod, "repl"), tag.Insert(KeyStatus, "OK"))
607607
if err != nil {
608608
return err
609609
}
@@ -702,7 +702,7 @@ func main() {
702702
// readEvaluateProcess reads a line from the input reader and
703703
// then processes it. It returns an error if any was encountered.
704704
func readEvaluateProcess(br *bufio.Reader) (terr error) {
705-
ctx, _ := tag.New(context.Background(), tag.Insert(KeyMethod, "repl"), tag.Insert(KeyStatus, "OK"))
705+
ctx, err := tag.New(context.Background(), tag.Insert(KeyMethod, "repl"), tag.Insert(KeyStatus, "OK"))
706706
if err != nil {
707707
return err
708708
}
@@ -826,7 +826,7 @@ func main() {
826826
// readEvaluateProcess reads a line from the input reader and
827827
// then processes it. It returns an error if any was encountered.
828828
func readEvaluateProcess(br *bufio.Reader) (terr error) {
829-
ctx, _ := tag.New(context.Background(), tag.Insert(KeyMethod, "repl"), tag.Insert(KeyStatus, "OK"))
829+
ctx, err := tag.New(context.Background(), tag.Insert(KeyMethod, "repl"), tag.Insert(KeyStatus, "OK"))
830830
if err != nil {
831831
return err
832832
}
@@ -987,7 +987,7 @@ func main() {
987987
// readEvaluateProcess reads a line from the input reader and
988988
// then processes it. It returns an error if any was encountered.
989989
func readEvaluateProcess(br *bufio.Reader) (terr error) {
990-
ctx, _ := tag.New(context.Background(), tag.Insert(KeyMethod, "repl"), tag.Insert(KeyStatus, "OK"))
990+
ctx, err := tag.New(context.Background(), tag.Insert(KeyMethod, "repl"), tag.Insert(KeyStatus, "OK"))
991991
if err != nil {
992992
return err
993993
}
@@ -1148,7 +1148,7 @@ func main() {
11481148
// readEvaluateProcess reads a line from the input reader and
11491149
// then processes it. It returns an error if any was encountered.
11501150
func readEvaluateProcess(br *bufio.Reader) (terr error) {
1151-
ctx, _ := tag.New(context.Background(), tag.Insert(KeyMethod, "repl"), tag.Insert(KeyStatus, "OK"))
1151+
ctx, err := tag.New(context.Background(), tag.Insert(KeyMethod, "repl"), tag.Insert(KeyStatus, "OK"))
11521152
if err != nil {
11531153
return err
11541154
}
@@ -1373,7 +1373,7 @@ func main() {
13731373
// readEvaluateProcess reads a line from the input reader and
13741374
// then processes it. It returns an error if any was encountered.
13751375
func readEvaluateProcess(br *bufio.Reader) (terr error) {
1376-
ctx, _ := tag.New(context.Background(), tag.Insert(KeyMethod, "repl"), tag.Insert(KeyStatus, "OK"))
1376+
ctx, err := tag.New(context.Background(), tag.Insert(KeyMethod, "repl"), tag.Insert(KeyStatus, "OK"))
13771377
if err != nil {
13781378
return err
13791379
}

0 commit comments

Comments
 (0)