diff --git a/collector/meminfo_linux.go b/collector/meminfo_linux.go index 1a8556fd..433c317b 100644 --- a/collector/meminfo_linux.go +++ b/collector/meminfo_linux.go @@ -39,7 +39,7 @@ func parseMemInfo(r io.Reader) (map[string]float64, error) { var ( memInfo = map[string]float64{} scanner = bufio.NewScanner(r) - re = regexp.MustCompile("\\((.*)\\)") + re = regexp.MustCompile(`\((.*)\)`) ) for scanner.Scan() { diff --git a/collector/meminfo_numa_linux.go b/collector/meminfo_numa_linux.go index f6310c65..eb995e31 100644 --- a/collector/meminfo_numa_linux.go +++ b/collector/meminfo_numa_linux.go @@ -124,7 +124,7 @@ func parseMemInfoNuma(r io.Reader) ([]meminfoMetric, error) { var ( memInfo []meminfoMetric scanner = bufio.NewScanner(r) - re = regexp.MustCompile("\\((.*)\\)") + re = regexp.MustCompile(`\((.*)\)`) ) for scanner.Scan() { diff --git a/collector/netdev_linux_test.go b/collector/netdev_linux_test.go index 9f27e433..2adc12de 100644 --- a/collector/netdev_linux_test.go +++ b/collector/netdev_linux_test.go @@ -47,7 +47,7 @@ func TestNetDevStats(t *testing.T) { t.Errorf("want count of devices to be %d, got %d", want, got) } - if _, ok := netStats["veth4B09XN"]["transmit_bytes"]; ok != false { + if _, ok := netStats["veth4B09XN"]["transmit_bytes"]; ok { t.Error("want fixture interface veth4B09XN to not exist, but it does") } }