fix(lint): from golangci-lint warning.
https://github.com/appleboy/gorush/issues/704
This commit is contained in:
parent
99f9956b48
commit
0f6a5ac6c5
1
doc.go
1
doc.go
|
@ -51,5 +51,4 @@
|
|||
// }
|
||||
//
|
||||
// For more details, see the documentation and example.
|
||||
//
|
||||
package main
|
||||
|
|
8
main.go
8
main.go
|
@ -453,7 +453,13 @@ func pinger(cfg *config.ConfYaml) error {
|
|||
Timeout: time.Second * 10,
|
||||
Transport: transport,
|
||||
}
|
||||
resp, err := client.Get("http://localhost:" + cfg.Core.Port + cfg.API.HealthURI)
|
||||
req, _ := http.NewRequestWithContext(
|
||||
context.Background(),
|
||||
http.MethodGet,
|
||||
"http://localhost:"+cfg.Core.Port+cfg.API.HealthURI,
|
||||
nil,
|
||||
)
|
||||
resp, err := client.Do(req)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
|
|
@ -247,7 +247,7 @@ func markFailedNotification(
|
|||
|
||||
// HandleNotification add notification to queue list.
|
||||
func handleNotification(
|
||||
ctx context.Context,
|
||||
_ context.Context,
|
||||
cfg *config.ConfYaml,
|
||||
req notify.RequestPush,
|
||||
q *queue.Queue,
|
||||
|
|
|
@ -75,8 +75,13 @@ func testRequest(t *testing.T, url string) {
|
|||
Timeout: time.Second * 10,
|
||||
Transport: tr,
|
||||
}
|
||||
|
||||
resp, err := client.Get(url)
|
||||
req, _ := http.NewRequestWithContext(
|
||||
context.Background(),
|
||||
http.MethodGet,
|
||||
url,
|
||||
nil,
|
||||
)
|
||||
resp, err := client.Do(req)
|
||||
defer func() {
|
||||
if err := resp.Body.Close(); err != nil {
|
||||
log.Println("close body err:", err)
|
||||
|
|
Loading…
Reference in New Issue