Merge pull request #311 from gprggr/proc

pkg/proc: moving defer after error check
This commit is contained in:
Jonathan Boulle
2014-12-30 13:08:29 -08:00
+1 -1
View File
@@ -128,10 +128,10 @@ func LiveProcs(prefix string) (map[int][]string, error) {
// sockets open on the system accessing any paths with the given prefix
func unixSocketsWithPrefix(pre string) (map[string]string, error) {
fh, err := os.Open(unixSocks)
defer fh.Close()
if err != nil {
return nil, err
}
defer fh.Close()
socks := make(map[string]string)
scanner := bufio.NewScanner(fh)
for scanner.Scan() {