From 8edd2b3d1388cc525a6fdbaa73a2e5b839e20ad9 Mon Sep 17 00:00:00 2001 From: Todd Gruben Date: Mon, 11 Feb 2019 14:31:15 -0600 Subject: [PATCH] applied travis suggestions --- field.go | 8 +++++--- holder.go | 6 +++--- index.go | 4 +--- view.go | 4 +--- 4 files changed, 10 insertions(+), 12 deletions(-) diff --git a/field.go b/field.go index ab1829601..3f0b4a716 100644 --- a/field.go +++ b/field.go @@ -58,6 +58,10 @@ const ( FieldTypeBool = "bool" ) +func defaultShardValidator(shard uint64) bool { + return true +} + // Field represents a container for views. type Field struct { mu sync.RWMutex @@ -208,9 +212,7 @@ func newField(path, index, name string, opts FieldOption) (*Field, error) { remoteAvailableShards: roaring.NewBitmap(), - shardValidator: func(uint64) bool { - return true - }, + shardValidator: defaultShardValidator, logger: logger.NopLogger, } return f, nil diff --git a/holder.go b/holder.go index 8938b047b..d751c90b2 100644 --- a/holder.go +++ b/holder.go @@ -77,7 +77,7 @@ type Holder struct { // The interval at which the cached row ids are persisted to disk. cacheFlushInterval time.Duration - shardValidatorfn func(index string, shard uint64) bool + shardValidatorFunc func(index string, shard uint64) bool Logger logger.Logger } @@ -125,7 +125,7 @@ func NewHolder() *Holder { NewAttrStore: newNopAttrStore, cacheFlushInterval: defaultCacheFlushInterval, - shardValidatorfn: func(index string, shard uint64) bool { + shardValidatorFunc: func(index string, shard uint64) bool { return true //default }, @@ -431,7 +431,7 @@ func (h *Holder) newIndex(path, name string) (*Index, error) { index.newAttrStore = h.NewAttrStore index.columnAttrs = h.NewAttrStore(filepath.Join(index.path, ".data")) index.shardValidator = func(shard uint64) bool { - return h.shardValidatorfn(name, shard) + return h.shardValidatorFunc(name, shard) } return index, nil } diff --git a/index.go b/index.go index 9fa521361..53c8e9116 100644 --- a/index.go +++ b/index.go @@ -75,9 +75,7 @@ func NewIndex(path, name string) (*Index, error) { broadcaster: NopBroadcaster, Stats: stats.NopStatsClient, logger: logger.NopLogger, - shardValidator: func(uint64) bool { - return true - }, + shardValidator: defaultShardValidator, trackExistence: true, }, nil } diff --git a/view.go b/view.go index 7f10c54b8..ffef5a31c 100644 --- a/view.go +++ b/view.go @@ -76,9 +76,7 @@ func newView(path, index, field, name string, fieldOptions FieldOptions) *view { broadcaster: NopBroadcaster, stats: stats.NopStatsClient, logger: logger.NopLogger, - shardValidator: func(uint64) bool { - return true - }, + shardValidator: defaultShardValidator, } }