mirror of
https://github.com/appleboy/drone-discord.git
synced 2026-06-14 05:13:04 +08:00
refactor: refactor HTTP request handling and improve linter settings
- Remove the `exportloopref` linter from the golangci configuration - Add the `strconv` package import in `main.go` - Replace the `fmt.Sprintf` for the year with `strconv.Itoa` to convert the year to a string - Update the HTTP request method to use `http.MethodPost` instead of a string literal in `plugin.go` Signed-off-by: appleboy <appleboy.tw@gmail.com>
This commit is contained in:
@@ -163,7 +163,7 @@ func newfileUploadRequest(uri string, params map[string]string, paramName, path
|
||||
return nil, err
|
||||
}
|
||||
|
||||
req, err := http.NewRequest("POST", uri, body)
|
||||
req, err := http.NewRequest(http.MethodPost, uri, body)
|
||||
req.Header.Set("Content-Type", writer.FormDataContentType())
|
||||
return req, err
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user