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