Explicitly close open files

This commit is contained in:
Simon Waibl authored and Ed Schouten committed 2017-09-04 15:04:07 +02:00
1 parent a2a179a222
commit 26d010b2f0
1 file changed
+1
+1
View File
@@ -278,6 +278,7 @@ func CollectClientStatusFromReader(statusPath string, file io.Reader, ch chan<-
func CollectStatusFromFile(statusPath string, ch chan<- prometheus.Metric) error {
conn, err := os.Open(statusPath)
defer conn.Close()
if err != nil {
return err
}