From 5af077cd2d8ac5992d4d79661ee6a1db161204c4 Mon Sep 17 00:00:00 2001 From: Jinzhu Date: Mon, 11 May 2015 15:17:35 +0800 Subject: [PATCH] Handle []string for Select --- scope.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/scope.go b/scope.go index 559b4daa..21ad2991 100644 --- a/scope.go +++ b/scope.go @@ -368,6 +368,8 @@ func (scope *Scope) SelectAttrs() []string { for _, value := range scope.Search.selects { if str, ok := value.(string); ok { attrs = append(attrs, str) + } else if strs, ok := value.([]string); ok { + attrs = append(attrs, strs...) } else if strs, ok := value.([]interface{}); ok { for _, str := range strs { attrs = append(attrs, fmt.Sprintf("%v", str))