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 {
|
func CollectStatusFromFile(statusPath string, ch chan<- prometheus.Metric) error {
|
||||||
conn, err := os.Open(statusPath)
|
conn, err := os.Open(statusPath)
|
||||||
|
defer conn.Close()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in new issue
Block a user