feat: minio

pull/818/head
withchao 2 years ago
parent 94be8fc0c4
commit 658ddc8863

@ -145,10 +145,10 @@ func (m *Minio) initMinio(ctx context.Context) error {
log.ZWarn(context.Background(), "set sign bucket location cache panic", errors.New("failed to get private field value"), "recover", fmt.Sprintf("%+v", r), "development version", "github.com/minio/minio-go/v7 v7.0.61") log.ZWarn(context.Background(), "set sign bucket location cache panic", errors.New("failed to get private field value"), "recover", fmt.Sprintf("%+v", r), "development version", "github.com/minio/minio-go/v7 v7.0.61")
} }
}() }()
filed := reflect.ValueOf(m.sign).Elem().FieldByName("bucketLocCache") blc := reflect.ValueOf(m.sign).Elem().FieldByName("bucketLocCache")
zero := reflect.New(reflect.PtrTo(filed.Type())) vblc := reflect.New(reflect.PtrTo(blc.Type()))
*(*unsafe.Pointer)(zero.UnsafePointer()) = unsafe.Pointer(filed.UnsafeAddr()) *(*unsafe.Pointer)(vblc.UnsafePointer()) = unsafe.Pointer(blc.UnsafeAddr())
zero.Elem().Elem().Interface().(interface{ Set(string, string) }).Set(conf.Bucket, m.location) vblc.Elem().Elem().Interface().(interface{ Set(string, string) }).Set(conf.Bucket, m.location)
}() }()
m.init = true m.init = true
return nil return nil

Loading…
Cancel
Save