Add the comment to declare the out of memory issue when put large local file

This commit is contained in:
toranger
2019-01-31 19:08:28 +08:00
parent bf9ab1f8a7
commit 6c894b8e4d
3 changed files with 19 additions and 12 deletions

View File

@@ -26,7 +26,7 @@ func main() {
RequestHeader: true,
RequestBody: true,
ResponseHeader: true,
ResponseBody: true,
ResponseBody: false,
},
},
})

View File

@@ -20,8 +20,9 @@ func main() {
SecretID: os.Getenv("COS_SECRETID"),
SecretKey: os.Getenv("COS_SECRETKEY"),
Transport: &debug.DebugRequestTransport{
RequestHeader: true,
RequestBody: true,
RequestHeader: true,
// Notice when put a large file and set need the request body, might happend out of memory error.
RequestBody: false,
ResponseHeader: true,
ResponseBody: true,
},
@@ -54,4 +55,10 @@ func main() {
panic(err)
}
// Case3 put object by local file path
_, err = c.Object.PutFromFile(context.Background(), name, "./test", nil)
if err != nil {
panic(err)
}
}