Skip to content

Commit cc256c7

Browse files
committed
add godoc for fixes golint
1 parent 231af57 commit cc256c7

File tree

1 file changed

+17
-3
lines changed

1 file changed

+17
-3
lines changed

sqlite3_test/sqltest.go

Lines changed: 17 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,14 +11,17 @@ import (
1111
"time"
1212
)
1313

14+
// Dialect is a type of dialect of databases.
1415
type Dialect int
1516

17+
// Dialects for databases.
1618
const (
17-
SQLITE Dialect = iota
18-
POSTGRESQL
19-
MYSQL
19+
SQLITE Dialect = iota // SQLITE mean SQLite3 dialect
20+
POSTGRESQL // POSTGRESQL mean PostgreSQL dialect
21+
MYSQL // MYSQL mean MySQL dialect
2022
)
2123

24+
// DB provide context for the tests
2225
type DB struct {
2326
*testing.T
2427
*sql.DB
@@ -149,6 +152,7 @@ func makeBench() {
149152
}
150153
}
151154

155+
// TestResult is test for result
152156
func TestResult(t *testing.T) {
153157
db.tearDown()
154158
db.mustExec("create temporary table test (id " + db.serialPK() + ", name varchar(10))")
@@ -175,6 +179,7 @@ func TestResult(t *testing.T) {
175179
}
176180
}
177181

182+
// TestBlobs is test for blobs
178183
func TestBlobs(t *testing.T) {
179184
db.tearDown()
180185
var blob = []byte{0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15}
@@ -201,6 +206,7 @@ func TestBlobs(t *testing.T) {
201206
}
202207
}
203208

209+
// TestManyQueryRow is test for many query row
204210
func TestManyQueryRow(t *testing.T) {
205211
if testing.Short() {
206212
t.Log("skipping in short mode")
@@ -218,6 +224,7 @@ func TestManyQueryRow(t *testing.T) {
218224
}
219225
}
220226

227+
// TestTxQuery is test for transactional query
221228
func TestTxQuery(t *testing.T) {
222229
db.tearDown()
223230
tx, err := db.Begin()
@@ -256,6 +263,7 @@ func TestTxQuery(t *testing.T) {
256263
}
257264
}
258265

266+
// TestPreparedStmt is test for prepared statement
259267
func TestPreparedStmt(t *testing.T) {
260268
db.tearDown()
261269
db.mustExec("CREATE TABLE t (count INT)")
@@ -301,6 +309,7 @@ func TestPreparedStmt(t *testing.T) {
301309
// test -bench but calling Benchmark() from a benchmark test
302310
// currently hangs go.
303311

312+
// BenchmarkExec is benchmark for exec
304313
func BenchmarkExec(b *testing.B) {
305314
for i := 0; i < b.N; i++ {
306315
if _, err := db.Exec("select 1"); err != nil {
@@ -309,6 +318,7 @@ func BenchmarkExec(b *testing.B) {
309318
}
310319
}
311320

321+
// BenchmarkQuery is benchmark for query
312322
func BenchmarkQuery(b *testing.B) {
313323
for i := 0; i < b.N; i++ {
314324
var n sql.NullString
@@ -322,6 +332,7 @@ func BenchmarkQuery(b *testing.B) {
322332
}
323333
}
324334

335+
// BenchmarkParams is benchmark for params
325336
func BenchmarkParams(b *testing.B) {
326337
for i := 0; i < b.N; i++ {
327338
var n sql.NullString
@@ -335,6 +346,7 @@ func BenchmarkParams(b *testing.B) {
335346
}
336347
}
337348

349+
// BenchmarkStmt is benchmark for statement
338350
func BenchmarkStmt(b *testing.B) {
339351
st, err := db.Prepare("select ?, ?, ?, ?")
340352
if err != nil {
@@ -354,6 +366,7 @@ func BenchmarkStmt(b *testing.B) {
354366
}
355367
}
356368

369+
// BenchmarkRows is benchmark for rows
357370
func BenchmarkRows(b *testing.B) {
358371
db.once.Do(makeBench)
359372

@@ -378,6 +391,7 @@ func BenchmarkRows(b *testing.B) {
378391
}
379392
}
380393

394+
// BenchmarkStmtRows is benchmark for statement rows
381395
func BenchmarkStmtRows(b *testing.B) {
382396
db.once.Do(makeBench)
383397

0 commit comments

Comments
 (0)