Unexport Field.Keys

This commit is contained in:
Cody Soyland 2018-07-05 21:43:41 -05:00
parent ba9c5193b5
commit 16461345f6
2 changed files with 4 additions and 4 deletions

View file

@ -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)

View file

@ -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