Skip to content

Commit 0ff13e6

Browse files
committed
golint
1 parent f238067 commit 0ff13e6

File tree

2 files changed

+8
-6
lines changed

2 files changed

+8
-6
lines changed

sqlite_context.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ import (
3434

3535
const i64 = unsafe.Sizeof(int(0)) > 4
3636

37+
// SQLiteContext behave sqlite3_context
3738
type SQLiteContext C.sqlite3_context
3839

3940
// ResultBool sets the result of an SQL function.

vtable.go

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -51,8 +51,10 @@ type sqliteVTabCursor struct {
5151
vTabCursor VTabCursor
5252
}
5353

54+
// Op is type of operations.
5455
type Op uint8
5556

57+
// Op mean identity of operations.
5658
const (
5759
OpEQ Op = 2
5860
OpGT = 4
@@ -66,21 +68,22 @@ const (
6668
OpScanUnique = 1 /* Scan visits at most 1 row */
6769
)
6870

71+
// InfoConstraint give information of constraint.
6972
type InfoConstraint struct {
7073
Column int
7174
Op Op
7275
Usable bool
7376
}
7477

78+
// InfoOrderBy give information of order-by.
7579
type InfoOrderBy struct {
7680
Column int
7781
Desc bool
7882
}
7983

8084
func constraints(info *C.sqlite3_index_info) []InfoConstraint {
8185
l := info.nConstraint
82-
var constraints *C.struct_sqlite3_index_constraint = info.aConstraint
83-
slice := (*[1 << 30]C.struct_sqlite3_index_constraint)(unsafe.Pointer(constraints))[:l:l]
86+
slice := (*[1 << 30]C.struct_sqlite3_index_constraint)(unsafe.Pointer(info.aConstraint))[:l:l]
8487

8588
cst := make([]InfoConstraint, 0, l)
8689
for _, c := range slice {
@@ -99,8 +102,7 @@ func constraints(info *C.sqlite3_index_info) []InfoConstraint {
99102

100103
func orderBys(info *C.sqlite3_index_info) []InfoOrderBy {
101104
l := info.nOrderBy
102-
var obys *C.struct_sqlite3_index_orderby = info.aOrderBy
103-
slice := (*[1 << 30]C.struct_sqlite3_index_orderby)(unsafe.Pointer(obys))[:l:l]
105+
slice := (*[1 << 30]C.struct_sqlite3_index_orderby)(unsafe.Pointer(info.aOrderBy))[:l:l]
104106

105107
ob := make([]InfoOrderBy, 0, l)
106108
for _, c := range slice {
@@ -211,8 +213,7 @@ func goVBestIndex(pVTab unsafe.Pointer, icp unsafe.Pointer) *C.char {
211213

212214
// Get a pointer to constraint_usage struct so we can update in place.
213215
l := info.nConstraint
214-
var usg *C.struct_sqlite3_index_constraint_usage = info.aConstraintUsage
215-
s := (*[1 << 30]C.struct_sqlite3_index_constraint_usage)(unsafe.Pointer(usg))[:l:l]
216+
s := (*[1 << 30]C.struct_sqlite3_index_constraint_usage)(unsafe.Pointer(info.aConstraintUsage))[:l:l]
216217
index := 1
217218
for i := C.int(0); i < info.nConstraint; i++ {
218219
if res.Used[i] {

0 commit comments

Comments
 (0)