Fix go report card warnings
Project: http://git-wip-us.apache.org/repos/asf/calcite-avatica-go/repo Commit: http://git-wip-us.apache.org/repos/asf/calcite-avatica-go/commit/e749af5b Tree: http://git-wip-us.apache.org/repos/asf/calcite-avatica-go/tree/e749af5b Diff: http://git-wip-us.apache.org/repos/asf/calcite-avatica-go/diff/e749af5b Branch: refs/heads/master Commit: e749af5bd0bca528e41c8b9d37297ff57b5ad31c Parents: e9f8bda Author: Francis Chuang <francis.chu...@boostport.com> Authored: Sun Jun 18 13:12:41 2017 +1000 Committer: Julian Hyde <jh...@apache.org> Committed: Thu Aug 10 18:47:11 2017 -0700 ---------------------------------------------------------------------- compat_go18.go | 2 +- driver_test.go | 4 ++++ dsn.go | 2 +- errors.go | 6 +++++- 4 files changed, 11 insertions(+), 3 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/calcite-avatica-go/blob/e749af5b/compat_go18.go ---------------------------------------------------------------------- diff --git a/compat_go18.go b/compat_go18.go index 47d9832..56811fc 100644 --- a/compat_go18.go +++ b/compat_go18.go @@ -14,7 +14,7 @@ func driverNamedValueToNamedValue(values []driver.NamedValue) ([]namedValue, err list[i] = namedValue(nv) if nv.Name != "" { - return list, fmt.Errorf("named paramters are not supported: %s given", nv.Name) + return list, fmt.Errorf("named parameters are not supported: %s given", nv.Name) } } http://git-wip-us.apache.org/repos/asf/calcite-avatica-go/blob/e749af5b/driver_test.go ---------------------------------------------------------------------- diff --git a/driver_test.go b/driver_test.go index c77601e..737946e 100644 --- a/driver_test.go +++ b/driver_test.go @@ -683,6 +683,10 @@ func TestPreparedStatements(t *testing.T) { queryStmt, err := dbt.db.Prepare(`SELECT * FROM ` + dbt.tableName + ` WHERE int = ?`) + if err != nil{ + dbt.Fatal(err) + } + var res int for i := 1; i <= totalRows; i++ { http://git-wip-us.apache.org/repos/asf/calcite-avatica-go/blob/e749af5b/dsn.go ---------------------------------------------------------------------- diff --git a/dsn.go b/dsn.go index 1bfa542..d20919d 100644 --- a/dsn.go +++ b/dsn.go @@ -11,7 +11,7 @@ import ( type authentication int const ( - none authentication = iota + none authentication = iota basic digest ) http://git-wip-us.apache.org/repos/asf/calcite-avatica-go/blob/e749af5b/errors.go ---------------------------------------------------------------------- diff --git a/errors.go b/errors.go index 52981e3..e9753a8 100644 --- a/errors.go +++ b/errors.go @@ -1,9 +1,10 @@ package avatica import ( - "github.com/Boostport/avatica/message" "regexp" "strconv" + + "github.com/Boostport/avatica/message" ) // Error severity codes @@ -19,7 +20,10 @@ type RPCMetadata struct { ServerAddress string } +// ErrorCode represents the error code returned by the avatica server type ErrorCode uint32 + +// SQLState represents the SQL code returned by the avatica server type SQLState string // ResponseError is an error type that contains detailed information on