From d9def5ad1bacb7d747c85171df98b2ae9752aab1 Mon Sep 17 00:00:00 2001 From: marvin Date: Mon, 17 Jan 2022 10:47:19 +0800 Subject: [PATCH] rename package --- README.md | 4 ++-- README_zh.md | 4 ++-- conn_pool.go | 2 +- sharding.go | 2 +- sharding_test.go | 2 +- 5 files changed, 7 insertions(+), 7 deletions(-) diff --git a/README.md b/README.md index 1e917dc..f219991 100644 --- a/README.md +++ b/README.md @@ -29,7 +29,7 @@ The `Register` function takes a map, the key is the **original table name** and ## Usage Example ```go -sharding := gormsharding.Register(map[string]gormsharding.Resolver{ +middleware := sharding.Register(map[string]sharding.Resolver{ "orders": { EnableFullTable: true, ShardingColumn: "user_id", @@ -49,7 +49,7 @@ sharding := gormsharding.Register(map[string]gormsharding.Resolver{ } }, }) -db.Use(sharding) +db.Use(middleware) ``` ## Config description diff --git a/README_zh.md b/README_zh.md index b8edcaf..3565a66 100644 --- a/README_zh.md +++ b/README_zh.md @@ -25,7 +25,7 @@ go get -u github.com/longbridgeapp/gorm-sharding ## 用法示例 ```go -sharding := gormsharding.Register(map[string]gormsharding.Resolver{ +middleware := sharding.Register(map[string]sharding.Resolver{ "orders": { EnableFullTable: true, ShardingColumn: "user_id", @@ -45,7 +45,7 @@ sharding := gormsharding.Register(map[string]gormsharding.Resolver{ } }, }) -db.Use(sharding) +db.Use(middleware) ``` ## 配置描述 diff --git a/conn_pool.go b/conn_pool.go index 12ddafe..ca4bd30 100644 --- a/conn_pool.go +++ b/conn_pool.go @@ -1,4 +1,4 @@ -package gormsharding +package sharding import ( "context" diff --git a/sharding.go b/sharding.go index 2e54da8..4ddfbb1 100644 --- a/sharding.go +++ b/sharding.go @@ -1,4 +1,4 @@ -package gormsharding +package sharding import ( "errors" diff --git a/sharding_test.go b/sharding_test.go index 702017b..e7caa24 100644 --- a/sharding_test.go +++ b/sharding_test.go @@ -1,4 +1,4 @@ -package gormsharding +package sharding import ( "fmt"