From 8389d92f783142e7b15c3b2a32614e16a105d74b Mon Sep 17 00:00:00 2001 From: Jay Taylor Date: Mon, 23 Mar 2015 15:11:41 -0700 Subject: [PATCH] Futher clarified error messaging for invalid `plucks'. --- scope_private.go | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/scope_private.go b/scope_private.go index d1f4a10b..8de12ced 100644 --- a/scope_private.go +++ b/scope_private.go @@ -3,7 +3,6 @@ package gorm import ( "database/sql" "database/sql/driver" - "errors" "fmt" "reflect" "regexp" @@ -360,7 +359,7 @@ func (scope *Scope) pluck(column string, value interface{}) *Scope { dest := reflect.Indirect(reflect.ValueOf(value)) scope.Search.Select(column) if dest.Kind() != reflect.Slice { - scope.Err(errors.New("results should be a slice")) + scope.Err(fmt.Errorf("results should be a slice, not %s", dest.Kind())) return scope }