From f2935ce1d9352499ecb113d0cc8dc173fe9f0a03 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mateusz=20K=C4=99pczy=C5=84ski?= Date: Thu, 28 Nov 2024 11:00:53 +0100 Subject: [PATCH] feat(attributes): add proc status and mem info for linux --- procmeminfo.go | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) diff --git a/procmeminfo.go b/procmeminfo.go index 22dd52f..98594f6 100644 --- a/procmeminfo.go +++ b/procmeminfo.go @@ -52,18 +52,12 @@ var ( ) func readMemProcInfo() { - done := make(chan bool, 2) for _, path := range paths { - go readFile(path, done) - } - - // wait for readFile to finish - for i := 0; i < 2; i++ { - <-done + readFile(path) } } -func readFile(path string, done chan bool) { +func readFile(path string) { file, err := os.Open(path) if err != nil { log.Fatal(err) @@ -94,7 +88,6 @@ func readFile(path string, done chan bool) { } } } - done <- true } func mapValues(key string, value string, mapper map[string]string) {