From 037fdd334cb82f1ec742d3f98be226551cf1158a Mon Sep 17 00:00:00 2001 From: michaelyou Date: Wed, 14 Mar 2018 11:17:57 +0800 Subject: [PATCH] Simplify get Value As has checked v.Kind above, no need to use indirect to get the value --- sqlx.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sqlx.go b/sqlx.go index e6494739..4385c3fa 100644 --- a/sqlx.go +++ b/sqlx.go @@ -601,7 +601,7 @@ func (r *Rows) StructScan(dest interface{}) error { return errors.New("must pass a pointer, not a value, to StructScan destination") } - v = reflect.Indirect(v) + v = v.Elem() if !r.started { columns, err := r.Columns()