Explicitly close open files
This commit is contained in:
1 parent
a2a179a222
commit
26d010b2f0
1 file changed
+1
@@ -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
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user