Browse Source

fix demo

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

2
example/object/moveObject.go

@ -59,7 +59,7 @@ func main() {
// 重命名
dest := "test/newfile"
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)
if err == nil {
_, err = c.Object.Delete(context.Background(), source, nil)

4
object.go

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

Loading…
Cancel
Save