diff options
author | Christian Hoffmann <christian@hoffie.info> | 2018-07-30 07:57:18 +0200 |
---|---|---|
committer | Ben Kochie <superq@gmail.com> | 2018-07-30 07:57:18 +0200 |
commit | 6bdc5558ecfa90f81107f65fc14f55ac46f69643 (patch) | |
tree | 58786c0994af5542e8d3a87ed913ae8b9c450692 | |
parent | 80a5712b97cd649b6bf2f9f60cf5c497043ef187 (diff) | |
download | prometheus_node_collector-6bdc5558ecfa90f81107f65fc14f55ac46f69643.tar.bz2 prometheus_node_collector-6bdc5558ecfa90f81107f65fc14f55ac46f69643.tar.xz prometheus_node_collector-6bdc5558ecfa90f81107f65fc14f55ac46f69643.zip |
build: make staticcheck happy by using real regexp patterns #1025 (#1026)
Signed-off-by: Christian Hoffmann <mail@hoffmann-christian.info>
-rw-r--r-- | collector/systemd_linux_test.go | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/collector/systemd_linux_test.go b/collector/systemd_linux_test.go index 82237bd..3d7d7f6 100644 --- a/collector/systemd_linux_test.go +++ b/collector/systemd_linux_test.go | |||
@@ -109,8 +109,8 @@ func TestSystemdCollectorDoesntCrash(t *testing.T) { | |||
109 | 109 | ||
110 | func TestSystemdIgnoreFilter(t *testing.T) { | 110 | func TestSystemdIgnoreFilter(t *testing.T) { |
111 | fixtures := getUnitListFixtures() | 111 | fixtures := getUnitListFixtures() |
112 | whitelistPattern := regexp.MustCompile("foo") | 112 | whitelistPattern := regexp.MustCompile("^foo$") |
113 | blacklistPattern := regexp.MustCompile("bar") | 113 | blacklistPattern := regexp.MustCompile("^bar$") |
114 | filtered := filterUnits(fixtures[0], whitelistPattern, blacklistPattern) | 114 | filtered := filterUnits(fixtures[0], whitelistPattern, blacklistPattern) |
115 | for _, unit := range filtered { | 115 | for _, unit := range filtered { |
116 | if blacklistPattern.MatchString(unit.Name) || !whitelistPattern.MatchString(unit.Name) { | 116 | if blacklistPattern.MatchString(unit.Name) || !whitelistPattern.MatchString(unit.Name) { |