From 49c1f78115e0962f96dcc0a3743d1c2b08efb7e6 Mon Sep 17 00:00:00 2001 From: Lunny Xiao Date: Fri, 27 Mar 2020 14:53:43 +0800 Subject: [PATCH] Fix vet --- .drone.yml | 5 ++--- README.md | 2 ++ dialects/mssql.go | 6 +++++- dialects/mysql.go | 6 +++++- dialects/oracle.go | 6 +++++- dialects/postgres.go | 6 +++++- dialects/sqlite3.go | 6 +++++- doc.go | 2 +- 8 files changed, 30 insertions(+), 9 deletions(-) diff --git a/.drone.yml b/.drone.yml index 8e984bd9..7a18e0d6 100644 --- a/.drone.yml +++ b/.drone.yml @@ -3,12 +3,13 @@ kind: pipeline name: testing steps: - name: test-vet - image: golang:1.11 + image: golang:1.11 # The lowest golang requirement environment: GO111MODULE: "on" GOPROXY: "https://goproxy.cn" commands: - make vet + - make test when: event: - push @@ -20,11 +21,9 @@ steps: GO111MODULE: "on" GOPROXY: "https://goproxy.cn" commands: - - make test - make test-sqlite - TEST_CACHE_ENABLE=true make test-sqlite - TEST_QUOTE_POLICY=reserved make test-sqlite - when: event: - push diff --git a/README.md b/README.md index 2dc4d6eb..7334e6d4 100644 --- a/README.md +++ b/README.md @@ -67,6 +67,8 @@ Drivers for Go's sql package which currently support database/sql includes: * Create Engine +Firstly, we should new an engine for a database. + ```Go engine, err := xorm.NewEngine(driverName, dataSourceName) ``` diff --git a/dialects/mssql.go b/dialects/mssql.go index ae3f4afd..8ef924b8 100644 --- a/dialects/mssql.go +++ b/dialects/mssql.go @@ -205,7 +205,11 @@ var ( "PROC": true, } - mssqlQuoter = schemas.Quoter{'[', ']', schemas.AlwaysReserve} + mssqlQuoter = schemas.Quoter{ + Prefix: '[', + Suffix: ']', + IsReserved: schemas.AlwaysReserve, + } ) type mssql struct { diff --git a/dialects/mysql.go b/dialects/mysql.go index b61bc7da..ac916c89 100644 --- a/dialects/mysql.go +++ b/dialects/mysql.go @@ -162,7 +162,11 @@ var ( "ZEROFILL": true, } - mysqlQuoter = schemas.Quoter{'`', '`', schemas.AlwaysReserve} + mysqlQuoter = schemas.Quoter{ + Prefix: '`', + Suffix: '`', + IsReserved: schemas.AlwaysReserve, + } ) type mysql struct { diff --git a/dialects/oracle.go b/dialects/oracle.go index c8aaf97e..2620b0bb 100644 --- a/dialects/oracle.go +++ b/dialects/oracle.go @@ -499,7 +499,11 @@ var ( "ZONE": true, } - oracleQuoter = schemas.Quoter{'[', ']', schemas.AlwaysReserve} + oracleQuoter = schemas.Quoter{ + Prefix: '[', + Suffix: ']', + IsReserved: schemas.AlwaysReserve, + } ) type oracle struct { diff --git a/dialects/postgres.go b/dialects/postgres.go index ac64c093..1996c49d 100644 --- a/dialects/postgres.go +++ b/dialects/postgres.go @@ -767,7 +767,11 @@ var ( "ZONE": true, } - postgresQuoter = schemas.Quoter{'"', '"', schemas.AlwaysReserve} + postgresQuoter = schemas.Quoter{ + Prefix: '"', + Suffix: '"', + IsReserved: schemas.AlwaysReserve, + } ) var ( diff --git a/dialects/sqlite3.go b/dialects/sqlite3.go index 812a3698..0e910934 100644 --- a/dialects/sqlite3.go +++ b/dialects/sqlite3.go @@ -144,7 +144,11 @@ var ( "WITHOUT": true, } - sqlite3Quoter = schemas.Quoter{'`', '`', schemas.AlwaysReserve} + sqlite3Quoter = schemas.Quoter{ + Prefix: '`', + Suffix: '`', + IsReserved: schemas.AlwaysReserve, + } ) type sqlite3 struct { diff --git a/doc.go b/doc.go index 8df4fb30..ea6a2226 100644 --- a/doc.go +++ b/doc.go @@ -8,7 +8,7 @@ Package xorm is a simple and powerful ORM for Go. Installation -Make sure you have installed Go 1.6+ and then: +Make sure you have installed Go 1.11+ and then: go get xorm.io/xorm