From 6bdc5558ecfa90f81107f65fc14f55ac46f69643 Mon Sep 17 00:00:00 2001 From: Christian Hoffmann Date: Mon, 30 Jul 2018 07:57:18 +0200 Subject: [PATCH] build: make staticcheck happy by using real regexp patterns #1025 (#1026) Signed-off-by: Christian Hoffmann --- collector/systemd_linux_test.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/collector/systemd_linux_test.go b/collector/systemd_linux_test.go index 82237bd9..3d7d7f6c 100644 --- a/collector/systemd_linux_test.go +++ b/collector/systemd_linux_test.go @@ -109,8 +109,8 @@ func TestSystemdCollectorDoesntCrash(t *testing.T) { func TestSystemdIgnoreFilter(t *testing.T) { fixtures := getUnitListFixtures() - whitelistPattern := regexp.MustCompile("foo") - blacklistPattern := regexp.MustCompile("bar") + whitelistPattern := regexp.MustCompile("^foo$") + blacklistPattern := regexp.MustCompile("^bar$") filtered := filterUnits(fixtures[0], whitelistPattern, blacklistPattern) for _, unit := range filtered { if blacklistPattern.MatchString(unit.Name) || !whitelistPattern.MatchString(unit.Name) {