Fix errcheck warnings
Signed-off-by: z1cheng <imchench@gmail.com>
This commit is contained in:
parent
236a41a23b
commit
2bbd69e0d9
27 changed files with 207 additions and 70 deletions
|
|
@ -48,7 +48,10 @@ func TestProcessCollector(t *testing.T) {
|
|||
|
||||
done := make(chan struct{})
|
||||
go func() {
|
||||
cmd.Wait()
|
||||
err = cmd.Wait()
|
||||
if err != nil {
|
||||
t.Errorf("unexpected error waiting for dummy process: %v", err)
|
||||
}
|
||||
status := cmd.ProcessState.Sys().(syscall.WaitStatus)
|
||||
if status.Signaled() {
|
||||
t.Logf("Signal: %v", status.Signal())
|
||||
|
|
@ -69,8 +72,11 @@ func TestProcessCollector(t *testing.T) {
|
|||
defer func() {
|
||||
cm.Stop()
|
||||
|
||||
cmd.Process.Kill()
|
||||
err = cmd.Process.Kill()
|
||||
<-done
|
||||
if err != nil {
|
||||
t.Errorf("unexpected error killing dummy process: %v", err)
|
||||
}
|
||||
close(done)
|
||||
}()
|
||||
|
||||
|
|
|
|||
|
|
@ -58,7 +58,9 @@ func TestNewUDPLogListener(t *testing.T) {
|
|||
}()
|
||||
|
||||
conn, _ := net.Dial("unix", tmpFile)
|
||||
conn.Write([]byte("message"))
|
||||
if _, err := conn.Write([]byte("message")); err != nil {
|
||||
t.Errorf("unexpected error writing to unix socket: %v", err)
|
||||
}
|
||||
conn.Close()
|
||||
|
||||
time.Sleep(1 * time.Millisecond)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue