From 6554b2cf16e4550bf3c24f3cf39e73f11fe3dbe7 Mon Sep 17 00:00:00 2001 From: shengjh <1572099106@qq.com> Date: Fri, 25 Sep 2020 16:12:33 +0800 Subject: [PATCH] Fix bug for s3 storage Signed-off-by: shengjh <1572099106@qq.com> --- storage/pkg/storage.go | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/storage/pkg/storage.go b/storage/pkg/storage.go index 624d94d517..7d3b2eced2 100644 --- a/storage/pkg/storage.go +++ b/storage/pkg/storage.go @@ -3,9 +3,9 @@ package storage import ( "context" "errors" + S3Driver "github.com/czs007/suvlim/storage/internal/S3" minIODriver "github.com/czs007/suvlim/storage/internal/minio" tikvDriver "github.com/czs007/suvlim/storage/internal/tikv" - S3Driver "github.com/czs007/suvlim/storage/internal/S3" "github.com/czs007/suvlim/storage/pkg/types" ) @@ -28,6 +28,11 @@ func NewStore(ctx context.Context, driver types.DriverType) (types.Store, error) return store, nil case types.S3DRIVER: store , err = S3Driver.NewS3Driver(ctx) + if err != nil { + //panic(err.Error()) + return nil, err + } + return store, nil } return nil, errors.New("unsupported driver") } \ No newline at end of file