mirror of
https://github.com/fumiama/NanoBot.git
synced 2026-06-06 11:10:24 +08:00
reduce unsafe
This commit is contained in:
@@ -11,7 +11,6 @@ package nano
|
||||
|
||||
import (
|
||||
"io"
|
||||
"unsafe"
|
||||
|
||||
"github.com/pkg/errors"
|
||||
)
|
||||
@@ -27,7 +26,7 @@ func (bot *Bot) patchOpenAPIof[T any](ep string, body io.Reader) (*[T any], erro
|
||||
if err != nil {
|
||||
err = errors.Wrap(err, getCallerFuncName())
|
||||
}
|
||||
return (*[T any])(unsafe.Add(unsafe.Pointer(resp), unsafe.Sizeof(CodeMessageBase{}))), err
|
||||
return &resp.[T any], err
|
||||
}
|
||||
`
|
||||
|
||||
|
||||
Reference in New Issue
Block a user