From f35ce3d880cb1d0b6754edaac2738eb6a3a23f0a Mon Sep 17 00:00:00 2001 From: Yati Padia Date: Sun, 11 Jul 2021 12:11:39 +0530 Subject: [PATCH] cleanup: Adds t.Helper() to test helper function This commit adds t.Helper() to the test helper function. With this call go test prints correct lines of code for failed tests. Otherwise, printed lines will be inside helpers functions. For more details check: https://github.com/kulti/thelper Updates: #1586 Signed-off-by: Yati Padia --- internal/util/topology_test.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/internal/util/topology_test.go b/internal/util/topology_test.go index 43bafa22f..c01106545 100644 --- a/internal/util/topology_test.go +++ b/internal/util/topology_test.go @@ -24,12 +24,14 @@ import ( ) func checkError(t *testing.T, msg string, err error) { + t.Helper() if err == nil { t.Errorf(msg) } } func checkAndReportError(t *testing.T, msg string, err error) { + t.Helper() if err != nil { t.Errorf("%s (%v)", msg, err) }