Skip to content

Commit e987373

Browse files
ybelMekksindrerh2Reasonable-Solutions
committed
chore(mod): add error handler
* format kode Co-authored-by: Sindre Rødseth Hansen <[email protected]> Co-authored-by: Carl Hedgren <[email protected]>
1 parent 7337c4f commit e987373

File tree

2 files changed

+10
-2
lines changed

2 files changed

+10
-2
lines changed

pkg/debug/debug.go

+8
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,10 @@ func (d *Debug) Debug() error {
7070
}
7171

7272
pods, err := d.getPods(app)
73+
if err != nil {
74+
return err
75+
}
76+
7377
var podNames []string
7478
for _, pod := range pods.Items {
7579
podNames = append(podNames, pod.Name)
@@ -153,6 +157,10 @@ func (d *Debug) Tidy() error {
153157
}
154158

155159
pods, err := d.getPods(app)
160+
if err != nil {
161+
return err
162+
}
163+
156164
var podNames []string
157165
for _, pod := range pods.Items {
158166
podNames = append(podNames, pod.Name)

pkg/metrics/otel.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,13 @@ package metrics
22

33
import (
44
"context"
5-
"github.com/urfave/cli/v2"
65
"log"
76
"os"
87
"strings"
98
"time"
109

10+
"github.com/urfave/cli/v2"
11+
1112
"go.opentelemetry.io/otel/attribute"
1213
"go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetrichttp"
1314
m "go.opentelemetry.io/otel/metric"
@@ -71,7 +72,6 @@ func recordCommandUsage(ctx context.Context, provider *metric.MeterProvider, fla
7172
// Just a list intersection, used to create the intersection
7273
// between os.args and all the args we have in the cli
7374
func intersection(list1, list2 []string) []string {
74-
7575
elements := make(map[string]bool)
7676
seen := make(map[string]bool)
7777

0 commit comments

Comments
 (0)