From 658ddc8863b82eed37d1260251cacbdd14229366 Mon Sep 17 00:00:00 2001 From: withchao <993506633@qq.com> Date: Mon, 7 Aug 2023 12:03:55 +0800 Subject: [PATCH] feat: minio --- pkg/common/db/s3/minio/minio.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/pkg/common/db/s3/minio/minio.go b/pkg/common/db/s3/minio/minio.go index 19e722807..d9a59230a 100644 --- a/pkg/common/db/s3/minio/minio.go +++ b/pkg/common/db/s3/minio/minio.go @@ -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") } }() - filed := reflect.ValueOf(m.sign).Elem().FieldByName("bucketLocCache") - zero := reflect.New(reflect.PtrTo(filed.Type())) - *(*unsafe.Pointer)(zero.UnsafePointer()) = unsafe.Pointer(filed.UnsafeAddr()) - zero.Elem().Elem().Interface().(interface{ Set(string, string) }).Set(conf.Bucket, m.location) + blc := reflect.ValueOf(m.sign).Elem().FieldByName("bucketLocCache") + vblc := reflect.New(reflect.PtrTo(blc.Type())) + *(*unsafe.Pointer)(vblc.UnsafePointer()) = unsafe.Pointer(blc.UnsafeAddr()) + vblc.Elem().Elem().Interface().(interface{ Set(string, string) }).Set(conf.Bucket, m.location) }() m.init = true return nil