From 472347009fc057071c97c6f347f06bb1b5b2267c Mon Sep 17 00:00:00 2001 From: Sebastien Binet Date: Fri, 22 May 2020 10:12:26 +0200 Subject: [PATCH] groot/rsql/rsqldrv: apply staticcheck fixes --- groot/rsql/rsqldrv/driver.go | 2 -- groot/rsql/rsqldrv/expr.go | 6 +----- groot/rsql/rsqldrv/rsqldrv_example_test.go | 1 - groot/rsql/rsqldrv/types.go | 6 +++--- 4 files changed, 4 insertions(+), 11 deletions(-) diff --git a/groot/rsql/rsqldrv/driver.go b/groot/rsql/rsqldrv/driver.go index b50fd4b5c..22ee2ba96 100644 --- a/groot/rsql/rsqldrv/driver.go +++ b/groot/rsql/rsqldrv/driver.go @@ -124,8 +124,6 @@ type driverConn struct { drv *rootDriver stop map[*driverStmt]struct{} refs int - - tx driver.Tx } // Prepare returns a prepared statement, bound to this connection. diff --git a/groot/rsql/rsqldrv/expr.go b/groot/rsql/rsqldrv/expr.go index 712b2dc5b..7ef7604e3 100644 --- a/groot/rsql/rsqldrv/expr.go +++ b/groot/rsql/rsqldrv/expr.go @@ -10,7 +10,6 @@ import ( "reflect" "strconv" "strings" - "sync" "github.com/xwb1989/sqlparser" ) @@ -23,10 +22,7 @@ type expression interface { } type execCtx struct { - db *driverConn - args []interface{} - cache map[interface{}]interface{} - mu sync.RWMutex + db *driverConn } func newExecCtx(db *driverConn, args []driver.NamedValue) *execCtx { diff --git a/groot/rsql/rsqldrv/rsqldrv_example_test.go b/groot/rsql/rsqldrv/rsqldrv_example_test.go index 32ef23ba4..c7ab6086e 100644 --- a/groot/rsql/rsqldrv/rsqldrv_example_test.go +++ b/groot/rsql/rsqldrv/rsqldrv_example_test.go @@ -11,7 +11,6 @@ import ( "go-hep.org/x/hep/groot" "go-hep.org/x/hep/groot/rsql/rsqldrv" - _ "go-hep.org/x/hep/groot/rsql/rsqldrv" "go-hep.org/x/hep/groot/rtree" ) diff --git a/groot/rsql/rsqldrv/types.go b/groot/rsql/rsqldrv/types.go index 9da9b57fb..e1de91e86 100644 --- a/groot/rsql/rsqldrv/types.go +++ b/groot/rsql/rsqldrv/types.go @@ -159,15 +159,15 @@ func coerce1(inVal, otherVal interface{}) (coercedInVal interface{}) { } //case string: case uint8: - if x >= 0 && x <= math.MaxUint8 { + if x <= math.MaxUint8 { return uint8(int64(x)) } case uint16: - if x >= 0 && x <= math.MaxUint16 { + if x <= math.MaxUint16 { return uint16(int64(x)) } case uint32: - if x >= 0 && x <= math.MaxUint32 { + if x <= math.MaxUint32 { return uint32(int64(x)) } case uint64: