build: make staticcheck happy by using real regexp patterns #1025 (#1026)

Signed-off-by: Christian Hoffmann <mail@hoffmann-christian.info>
This commit is contained in:
Christian Hoffmann 2018-07-30 07:57:18 +02:00 committed by Ben Kochie
parent 80a5712b97
commit 6bdc5558ec
1 changed files with 2 additions and 2 deletions

View File

@ -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) {