File tree 3 files changed +41
-4
lines changed
3 files changed +41
-4
lines changed Original file line number Diff line number Diff line change
1
+ run :
2
+ concurrency : 4
3
+ timeout : 5m
4
+ issues-exit-code : 1
5
+ tests : true
6
+ modules-download-mode : readonly
7
+
8
+ linters-settings :
9
+ govet :
10
+ enable-all : true
11
+ disable :
12
+ - shadow
13
+ - fieldalignment
14
+ gosec :
15
+ includes : []
16
+
17
+ linters :
18
+ disable-all : true
19
+ enable :
20
+ - err113
21
+ - gofmt
22
+ - goimports
23
+ - govet
24
+ - ineffassign
25
+ - misspell
26
+ - staticcheck
27
+ - unused
28
+ - goheader
29
+ - gosec
Original file line number Diff line number Diff line change @@ -6,11 +6,15 @@ DOCKER_TAG := latest
6
6
# Go build flags
7
7
GO_BUILD_FLAGS := -ldflags="-s -w"
8
8
9
- .PHONY : all build docker clean
9
+ .PHONY : all build docker clean lint
10
10
11
- all : build docker push
11
+ all : lint build docker push
12
12
13
- build :
13
+ lint :
14
+ @echo " Running golangci-lint..."
15
+ golangci-lint run ./...
16
+
17
+ build : lint
14
18
@echo " Building Go binary..."
15
19
go build $(GO_BUILD_FLAGS ) -o $(BINARY_NAME ) ./cmd/main.go
16
20
Original file line number Diff line number Diff line change @@ -2,6 +2,7 @@ package iperf
2
2
3
3
import (
4
4
"context"
5
+ "errors"
5
6
"fmt"
6
7
"os"
7
8
"os/signal"
@@ -16,6 +17,9 @@ import (
16
17
"k8s.io/client-go/kubernetes"
17
18
)
18
19
20
+ // At the package level, add this static error:
21
+ var errIperf3ClientPodFailed = errors .New ("iperf3 client pod failed" )
22
+
19
23
// TestConfig holds the configuration for the iperf3 test
20
24
type TestConfig struct {
21
25
Client * kubernetes.Clientset
@@ -247,7 +251,7 @@ PodCompleted:
247
251
fmt .Println (string (logs ))
248
252
249
253
if podPhase == corev1 .PodFailed {
250
- return fmt .Errorf ("iperf3 client pod failed" )
254
+ return fmt .Errorf ("iperf3 client execution: %w" , errIperf3ClientPodFailed )
251
255
}
252
256
253
257
return nil
You can’t perform that action at this time.
0 commit comments