aboutsummaryrefslogtreecommitdiff
path: root/weed/operation
diff options
context:
space:
mode:
authorKonstantin Lebedev <9497591+kmlebedev@users.noreply.github.com>2024-07-01 13:00:39 +0500
committerGitHub <noreply@github.com>2024-07-01 01:00:39 -0700
commit5ffacbb6eacaad6ea9558d18f9c62be2a3c4e18f (patch)
treebf5797c6b002d953d03ae68fa37c7c4be7fabc40 /weed/operation
parent0fdf7eca48892b5c6d12c1c96563755945331f16 (diff)
downloadseaweedfs-5ffacbb6eacaad6ea9558d18f9c62be2a3c4e18f.tar.xz
seaweedfs-5ffacbb6eacaad6ea9558d18f9c62be2a3c4e18f.zip
refactor all methods strings to const (#5726)
Diffstat (limited to 'weed/operation')
-rw-r--r--weed/operation/chunked_file.go2
-rw-r--r--weed/operation/upload_content.go2
2 files changed, 2 insertions, 2 deletions
diff --git a/weed/operation/chunked_file.go b/weed/operation/chunked_file.go
index c451420fe..02faf9904 100644
--- a/weed/operation/chunked_file.go
+++ b/weed/operation/chunked_file.go
@@ -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
}
diff --git a/weed/operation/upload_content.go b/weed/operation/upload_content.go
index a1df07d7e..6c6aec1b5 100644
--- a/weed/operation/upload_content.go
+++ b/weed/operation/upload_content.go
@@ -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)