diff --git a/executor.go b/executor.go index b39e26f58..9b7f5d4bb 100644 --- a/executor.go +++ b/executor.go @@ -1577,7 +1577,7 @@ func (e *executor) translateCall(index string, idx *Index, c *pql.Call) error { if field == nil { return ErrFieldNotFound } - if field.Keys() { + if field.keys() { if c.Args[rowKey] != nil && !isString(c.Args[rowKey]) { return errors.New("row value must be a string when field 'keys' option enabled") } @@ -1628,7 +1628,7 @@ func (e *executor) translateResult(index string, idx *Index, call *pql.Call, res if field == nil { return nil, ErrFieldNotFound } - if field.Keys() { + if field.keys() { other := make([]Pair, len(result)) for i := range result { key, err := e.TranslateStore.TranslateRowToString(index, fieldName, result[i].ID) diff --git a/field.go b/field.go index b9d84cc83..69d08d504 100644 --- a/field.go +++ b/field.go @@ -428,8 +428,8 @@ func (f *Field) Close() error { return nil } -// Keys returns true if the field uses string keys. -func (f *Field) Keys() bool { +// keys returns true if the field uses string keys. +func (f *Field) keys() bool { f.mu.RLock() defer f.mu.RUnlock() return f.options.Keys