fix golint issues in core/stores (#527)

This commit is contained in:
Kevin Wan
2021-02-28 23:02:49 +08:00
committed by GitHub
parent 490241d639
commit c566b5ff82
35 changed files with 348 additions and 82 deletions

View File

@@ -1,7 +1,6 @@
package kv
import (
"github.com/tal-tech/go-zero/core/stores/cache"
)
import "github.com/tal-tech/go-zero/core/stores/cache"
// KvConf is an alias of cache.ClusterConf.
type KvConf = cache.ClusterConf

View File

@@ -10,9 +10,11 @@ import (
"github.com/tal-tech/go-zero/core/stores/redis"
)
// ErrNoRedisNode is an error that indicates no redis node.
var ErrNoRedisNode = errors.New("no redis node")
type (
// Store interface represents a KV store.
Store interface {
Del(keys ...string) (int, error)
Eval(script string, key string, args ...interface{}) (interface{}, error)
@@ -81,6 +83,7 @@ type (
}
)
// NewStore returns a Store.
func NewStore(c KvConf) Store {
if len(c) == 0 || cache.TotalWeights(c) <= 0 {
log.Fatal("no cache nodes")