Skip to content

Commit

Permalink
groot/rsql/rsqldrv: apply staticcheck fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
sbinet committed May 22, 2020
1 parent 889375c commit 4723470
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 11 deletions.
2 changes: 0 additions & 2 deletions groot/rsql/rsqldrv/driver.go
Expand Up @@ -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.
Expand Down
6 changes: 1 addition & 5 deletions groot/rsql/rsqldrv/expr.go
Expand Up @@ -10,7 +10,6 @@ import (
"reflect"
"strconv"
"strings"
"sync"

"github.com/xwb1989/sqlparser"
)
Expand All @@ -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 {
Expand Down
1 change: 0 additions & 1 deletion groot/rsql/rsqldrv/rsqldrv_example_test.go
Expand Up @@ -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"
)

Expand Down
6 changes: 3 additions & 3 deletions groot/rsql/rsqldrv/types.go
Expand Up @@ -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:
Expand Down

0 comments on commit 4723470

Please sign in to comment.