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:
appleboy
2025-03-08 16:36:43 +08:00
parent 4d1d86d8c2
commit f2bd7836ef
3 changed files with 3 additions and 5 deletions
+1 -1
View File
@@ -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
}