Explorar o código

initialize params in get object api

hangzws %!s(int64=7) %!d(string=hai) anos
pai
achega
8c488d3abd
Modificáronse 1 ficheiros con 2 adicións e 2 borrados
  1. 2 2
      oss/bucket.go

+ 2 - 2
oss/bucket.go

@@ -191,7 +191,7 @@ func (bucket Bucket) GetObjectToFile(objectKey, filePath string, options ...Opti
 // error    it's nil if no error, otherwise it's an error object.
 //
 func (bucket Bucket) DoGetObject(request *GetObjectRequest, options []Option) (*GetObjectResult, error) {
-	params := map[string]interface{}{}
+	params, _ := getRawParams(options)
 	resp, err := bucket.do("GET", request.ObjectKey, params, options, nil, nil)
 	if err != nil {
 		return nil, err
@@ -871,7 +871,7 @@ func (bucket Bucket) GetObjectToFileWithURL(signedURL, filePath string, options
 // error    it's nil if no error, otherwise it's an error object.
 //
 func (bucket Bucket) DoGetObjectWithURL(signedURL string, options []Option) (*GetObjectResult, error) {
-	params := map[string]interface{}{}
+	params, _ := getRawParams(options)
 	resp, err := bucket.doURL("GET", signedURL, params, options, nil, nil)
 	if err != nil {
 		return nil, err