diff options
author | Ilya Mashchenko <ilya@netdata.cloud> | 2024-05-19 21:43:42 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-05-19 21:43:42 +0300 |
commit | 011d15a626fdbe817f826b6f2916b5310de16c2b (patch) | |
tree | e3a93d76bc8ba94d2323c69ae8f6d67abec12b3f /src/go/collectors/go.d.plugin/modules/openvpn | |
parent | 1ff4beab64cd72979f5dd07c13eddf11d582ac69 (diff) |
go.d fix some JB code inspection issues (#17702)
Diffstat (limited to 'src/go/collectors/go.d.plugin/modules/openvpn')
-rw-r--r-- | src/go/collectors/go.d.plugin/modules/openvpn/client/client_test.go | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/go/collectors/go.d.plugin/modules/openvpn/client/client_test.go b/src/go/collectors/go.d.plugin/modules/openvpn/client/client_test.go index c10673ed54..a21672e0b3 100644 --- a/src/go/collectors/go.d.plugin/modules/openvpn/client/client_test.go +++ b/src/go/collectors/go.d.plugin/modules/openvpn/client/client_test.go @@ -75,6 +75,7 @@ func (m *mockSocketClient) Disconnect() error { return nil } func (m *mockSocketClient) Command(command string, process socket.Processor) error { var s *bufio.Scanner + switch command { default: return fmt.Errorf("unknown command : %s", command) @@ -91,6 +92,10 @@ func (m *mockSocketClient) Command(command string, process socket.Processor) err s = bufio.NewScanner(bytes.NewReader(testLoadStatsData)) } + if s == nil { + return nil + } + for s.Scan() { process(s.Bytes()) } |