Function aux data.

This commit is contained in:
Nuno Cruces
2023-07-04 02:18:03 +01:00
parent 0f7fa6ebc9
commit 632ea933b3
7 changed files with 101 additions and 13 deletions

View File

@@ -29,7 +29,7 @@ func (s *handleState) Close() (err error) {
func GetHandle(ctx context.Context, id uint32) any {
if id == 0 {
panic(NilErr)
return nil
}
s := ctx.Value(handleKey{}).(*handleState)
return s.handles[^id]