Skip to content

Commit 2321e21

Browse files
committed
bump go version
1 parent 930de6e commit 2321e21

File tree

2 files changed

+6
-4
lines changed

2 files changed

+6
-4
lines changed

Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM golang:1.21 as builder
1+
FROM golang:1.22 as builder
22

33
ARG ARG_GOPROXY
44
ENV GOPROXY $ARG_GOPROXY

internal/ip/ip.go

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ package ip
22

33
import (
44
"encoding/json"
5-
"io/ioutil"
5+
"io"
66
"net/http"
77
)
88

@@ -26,13 +26,15 @@ func NewIfconfigCo() *IfconfigCo {
2626
}
2727

2828
func (i *IfconfigCo) GetIP() (string, error) {
29-
resp, err := http.DefaultClient.Get(IpConfigCoAddr)
29+
cli := http.Client{}
30+
defer cli.CloseIdleConnections()
31+
resp, err := cli.Get(IpConfigCoAddr)
3032
if err != nil {
3133
return "", err
3234
}
3335
defer resp.Body.Close()
3436

35-
s, err := ioutil.ReadAll(resp.Body)
37+
s, err := io.ReadAll(resp.Body)
3638
if err != nil {
3739
return "", err
3840
}

0 commit comments

Comments
 (0)