Simplify code

pull/480/head
Tobias Schmidt 2017-02-28 13:32:41 -04:00
parent 5289ffb270
commit 21e13c7f52
3 changed files with 3 additions and 3 deletions

View File

@ -39,7 +39,7 @@ func parseMemInfo(r io.Reader) (map[string]float64, error) {
var ( var (
memInfo = map[string]float64{} memInfo = map[string]float64{}
scanner = bufio.NewScanner(r) scanner = bufio.NewScanner(r)
re = regexp.MustCompile("\\((.*)\\)") re = regexp.MustCompile(`\((.*)\)`)
) )
for scanner.Scan() { for scanner.Scan() {

View File

@ -124,7 +124,7 @@ func parseMemInfoNuma(r io.Reader) ([]meminfoMetric, error) {
var ( var (
memInfo []meminfoMetric memInfo []meminfoMetric
scanner = bufio.NewScanner(r) scanner = bufio.NewScanner(r)
re = regexp.MustCompile("\\((.*)\\)") re = regexp.MustCompile(`\((.*)\)`)
) )
for scanner.Scan() { for scanner.Scan() {

View File

@ -47,7 +47,7 @@ func TestNetDevStats(t *testing.T) {
t.Errorf("want count of devices to be %d, got %d", want, got) 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") t.Error("want fixture interface veth4B09XN to not exist, but it does")
} }
} }