File tree 1 file changed +7
-1
lines changed 1 file changed +7
-1
lines changed Original file line number Diff line number Diff line change @@ -159,12 +159,14 @@ func (b *Backend) checkNodeVersion() (string, error) {
159
159
client := http.Client {
160
160
Timeout : 10 * time .Second ,
161
161
}
162
- resp , err := client .Get (fmt .Sprintf ("%s/eth/v1/node/version" , b .url .String ()))
163
162
163
+ resp , err := client .Get (fmt .Sprintf ("%s/eth/v1/node/version" , b .url .String ()))
164
164
if err != nil {
165
165
return "" , err
166
166
}
167
167
168
+ defer resp .Body .Close ()
169
+
168
170
r := struct {
169
171
Data struct {
170
172
Version string `json:"version"`
@@ -189,6 +191,8 @@ func (b *Backend) checkNodeSyncing() (*SyncInfo, error) {
189
191
return nil , err
190
192
}
191
193
194
+ defer resp .Body .Close ()
195
+
192
196
r := struct {
193
197
Data struct {
194
198
SyncInfo
@@ -213,6 +217,8 @@ func (b *Backend) checkNodePeerCount() (*PeerCountInfo, error) {
213
217
return nil , err
214
218
}
215
219
220
+ defer resp .Body .Close ()
221
+
216
222
// Some clients return the fields as int, others as strings, so we have to deal with both cases
217
223
r := struct {
218
224
Data struct {
You can’t perform that action at this time.
0 commit comments