Browse Source

fix demo

master
jojoliang 4 years ago
parent
commit
cc8dc719c2
  1. 2
      example/object/moveObject.go
  2. 2
      object.go

2
example/object/moveObject.go

@ -59,7 +59,7 @@ func main() {
// 重命名 // 重命名
dest := "test/newfile" dest := "test/newfile"
soruceURL := fmt.Sprintf("%s/%s", u.Host, source) soruceURL := fmt.Sprintf("%s/%s", u.Host, source)
_, _, err := c.Object.Copy(context.Background(), dest, soruceURL, nil)
_, _, err = c.Object.Copy(context.Background(), dest, soruceURL, nil)
log_status(err) log_status(err)
if err == nil { if err == nil {
_, err = c.Object.Delete(context.Background(), source, nil) _, err = c.Object.Delete(context.Background(), source, nil)

2
object.go

@ -940,7 +940,9 @@ func (s *ObjectService) Upload(ctx context.Context, name string, filepath string
var listener ProgressListener var listener ProgressListener
var consumedBytes int64 var consumedBytes int64
if opt.OptIni != nil { if opt.OptIni != nil {
if opt.OptIni.ObjectPutHeaderOptions != nil {
listener = opt.OptIni.Listener listener = opt.OptIni.Listener
}
optcom.XOptionHeader, _ = deliverInitOptions(opt.OptIni) optcom.XOptionHeader, _ = deliverInitOptions(opt.OptIni)
} }
event := newProgressEvent(ProgressStartedEvent, 0, 0, totalBytes) event := newProgressEvent(ProgressStartedEvent, 0, 0, totalBytes)

Loading…
Cancel
Save