diff options
author | Yasuhiro Matsumoto <mattn.jp@gmail.com> | 2024-01-25 22:36:00 +0900 |
---|---|---|
committer | mattn <mattn.jp@gmail.com> | 2024-01-25 22:55:22 +0900 |
commit | c91bca4fb499831d1bf62fb2b3019338d5a3eb41 (patch) | |
tree | eb8952f7b7c394790c620a65c20c74189f1fcb47 /callback.go | |
parent | Fix musl build (#1164) (diff) | |
download | golite-c91bca4fb499831d1bf62fb2b3019338d5a3eb41.tar.gz golite-c91bca4fb499831d1bf62fb2b3019338d5a3eb41.tar.xz |
update go version to 1.19
Diffstat (limited to 'callback.go')
-rw-r--r-- | callback.go | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/callback.go b/callback.go index d305691..0fb25a1 100644 --- a/callback.go +++ b/callback.go @@ -100,13 +100,13 @@ func preUpdateHookTrampoline(handle unsafe.Pointer, dbHandle uintptr, op int, db // Use handles to avoid passing Go pointers to C. type handleVal struct { db *SQLiteConn - val interface{} + val any } var handleLock sync.Mutex var handleVals = make(map[unsafe.Pointer]handleVal) -func newHandle(db *SQLiteConn, v interface{}) unsafe.Pointer { +func newHandle(db *SQLiteConn, v any) unsafe.Pointer { handleLock.Lock() defer handleLock.Unlock() val := handleVal{db: db, val: v} @@ -124,7 +124,7 @@ func lookupHandleVal(handle unsafe.Pointer) handleVal { return handleVals[handle] } -func lookupHandle(handle unsafe.Pointer) interface{} { +func lookupHandle(handle unsafe.Pointer) any { return lookupHandleVal(handle).val } @@ -238,7 +238,7 @@ func callbackArg(typ reflect.Type) (callbackArgConverter, error) { switch typ.Kind() { case reflect.Interface: if typ.NumMethod() != 0 { - return nil, errors.New("the only supported interface type is interface{}") + return nil, errors.New("the only supported interface type is any") } return callbackArgGeneric, nil case reflect.Slice: |