Commit da24c95c authored by weeellz's avatar weeellz Committed by Daniel Theophanes

database/sql: remove unnecessary else conditions

Fixes golint warning about "if block ends with a return statement,
so drop this else and outdent its block".

Change-Id: Iac4fd324e04e3e3fe3e3933f5e59095041d292c5
Reviewed-on: https://go-review.googlesource.com/107115Reviewed-by: default avatarDaniel Martí <mvdan@mvdan.cc>
Reviewed-by: default avatarDaniel Theophanes <kardianos@gmail.com>
Run-TryBot: Daniel Martí <mvdan@mvdan.cc>
TryBot-Result: Gobot Gobot <gobot@golang.org>
parent c63e047d
......@@ -379,10 +379,9 @@ func convertAssign(dest, src interface{}) error {
if src == nil {
dv.Set(reflect.Zero(dv.Type()))
return nil
} else {
dv.Set(reflect.New(dv.Type().Elem()))
return convertAssign(dv.Interface(), src)
}
dv.Set(reflect.New(dv.Type().Elem()))
return convertAssign(dv.Interface(), src)
case reflect.Int, reflect.Int8, reflect.Int16, reflect.Int32, reflect.Int64:
s := asString(src)
i64, err := strconv.ParseInt(s, 10, dv.Type().Bits())
......@@ -434,11 +433,10 @@ func strconvErr(err error) error {
func cloneBytes(b []byte) []byte {
if b == nil {
return nil
} else {
c := make([]byte, len(b))
copy(c, b)
return c
}
c := make([]byte, len(b))
copy(c, b)
return c
}
func asString(src interface{}) string {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment