GoAdminGroup / go-admin

Use http.NoBody instead of nil in http.NewRequest calls GO-R4001
Anti-pattern
Major
2 months ago2 months old
http.NoBody should be preferred to the nil request body
401
402func DownloadTo(url, output string) error {
403
404	req, err := http.NewRequest("GET", url, nil)405
406	if err != nil {
407		return err
http.NoBody should be preferred to the nil request body
169
170func GetOnline(reqData GetOnlineReq, token string) ([]byte, error) {
171	// TODO: add cache
172	req, err := http.NewRequest("GET", ServerHostApi+"/plugin/list?"+reqData.Format(), nil)173
174	if err != nil {
175		logger.Error("get online plugins: ", err)