Skip to content

Commit

Permalink
refactor: fix linter warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
marcboeker committed Jun 6, 2024
1 parent 23801de commit cc2ccf5
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 6 deletions.
5 changes: 3 additions & 2 deletions appender_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -527,9 +527,10 @@ func TestAppenderNullStruct(t *testing.T) {
for res.Next() {
var row any
err = res.Scan(&row)
if i == 0 {
switch i {
case 0:
require.NoError(t, err)
} else if i == 1 {
case 1:
require.Equal(t, nil, row)
}
i++
Expand Down
5 changes: 3 additions & 2 deletions appender_vector.go
Original file line number Diff line number Diff line change
Expand Up @@ -282,9 +282,10 @@ func (vec *vector) setCString(rowIdx C.idx_t, val any) {
}

var str string
if vec.duckdbType == C.DUCKDB_TYPE_VARCHAR {
switch vec.duckdbType {
case C.DUCKDB_TYPE_VARCHAR:
str = val.(string)
} else if vec.duckdbType == C.DUCKDB_TYPE_BLOB {
case C.DUCKDB_TYPE_BLOB:
str = string(val.([]byte)[:])
}

Expand Down
4 changes: 2 additions & 2 deletions rows.go
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@ func scan(vector C.duckdb_vector, rowIdx C.idx_t) (any, error) {
case C.DUCKDB_TYPE_STRUCT:
return scanStruct(columnType, vector, rowIdx)
case C.DUCKDB_TYPE_MAP:
return scanMap(columnType, vector, rowIdx)
return scanMap(vector, rowIdx)
case C.DUCKDB_TYPE_UUID:
hugeInt := get[C.duckdb_hugeint](vector, rowIdx)
return hugeIntToUUID(hugeInt), nil
Expand Down Expand Up @@ -289,7 +289,7 @@ func get[T any](vector C.duckdb_vector, rowIdx C.idx_t) T {
return xs[rowIdx]
}

func scanMap(ty C.duckdb_logical_type, vector C.duckdb_vector, rowIdx C.idx_t) (Map, error) {
func scanMap(vector C.duckdb_vector, rowIdx C.idx_t) (Map, error) {
list, err := scanList(vector, rowIdx)
if err != nil {
return nil, err
Expand Down

0 comments on commit cc2ccf5

Please sign in to comment.