We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 930de6e commit 2321e21Copy full SHA for 2321e21
Dockerfile
@@ -1,4 +1,4 @@
1
-FROM golang:1.21 as builder
+FROM golang:1.22 as builder
2
3
ARG ARG_GOPROXY
4
ENV GOPROXY $ARG_GOPROXY
internal/ip/ip.go
@@ -2,7 +2,7 @@ package ip
import (
"encoding/json"
5
- "io/ioutil"
+ "io"
6
"net/http"
7
)
8
@@ -26,13 +26,15 @@ func NewIfconfigCo() *IfconfigCo {
26
}
27
28
func (i *IfconfigCo) GetIP() (string, error) {
29
- resp, err := http.DefaultClient.Get(IpConfigCoAddr)
+ cli := http.Client{}
30
+ defer cli.CloseIdleConnections()
31
+ resp, err := cli.Get(IpConfigCoAddr)
32
if err != nil {
33
return "", err
34
35
defer resp.Body.Close()
36
- s, err := ioutil.ReadAll(resp.Body)
37
+ s, err := io.ReadAll(resp.Body)
38
39
40
0 commit comments