refactor all methods strings to const (#5726)

This commit is contained in:
Konstantin Lebedev authored and GitHub committed 2024-07-01 01:00:39 -07:00
1 parent 0fdf7eca48
commit 5ffacbb6ea
18 files changed
+84 -84

No files matched your search

+1 -1
View File
@@ -95,7 +95,7 @@ func (cm *ChunkManifest) DeleteChunks(masterFn GetMasterFn, usePublicUrl bool, g
}
func readChunkNeedle(fileUrl string, w io.Writer, offset int64, jwt string) (written int64, e error) {
req, err := http.NewRequest("GET", fileUrl, nil)
req, err := http.NewRequest(http.MethodGet, fileUrl, nil)
if err != nil {
return written, err
}
+1 -1
View File
@@ -325,7 +325,7 @@ func upload_content(fillBufferFunction func(w io.Writer) error, originalDataSize
} else {
reqReader = bytes.NewReader(option.BytesBuffer.Bytes())
}
req, postErr := http.NewRequest("POST", option.UploadUrl, reqReader)
req, postErr := http.NewRequest(http.MethodPost, option.UploadUrl, reqReader)
if postErr != nil {
glog.V(1).Infof("create upload request %s: %v", option.UploadUrl, postErr)
return nil, fmt.Errorf("create upload request %s: %v", option.UploadUrl, postErr)