We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
先贴代码:
func beforeSaveItem(req *leancloud.ClassHookRequest) (interface{}, error) { // 获取 Item item := new(Item) if err := req.Object.Clone(item); err != nil { return nil, err } // item 和 item.FromUser 都有正确的值 fmt.Println("-----beforeSaveItem: ", item) fmt.Printf("-----fromUser: %v\n\n", item.FromUser) // 一些针对其他字段的操作.... return item, nil }
我配置了 FromUser 字段是必填的,在没有这个 hook 函数时,一切正常。在有这个 hook 函数的时候,保存失败,返回错误信息:
fromUser is required.
是不是这块对于 Pointer 的处理可能有 bug,hook 函数返回的时候,不能正确读取 pointer 类型的字段?
The text was updated successfully, but these errors were encountered:
有人处理吗?
应该是没人吧 - -
Sorry, something went wrong.
这个应该是你定义类型时fromUser 类型不对。
fromUser
要用 leanCloud.User 不能用 *leancloud.User
leanCloud.User
*leancloud.User
No branches or pull requests
先贴代码:
我配置了 FromUser 字段是必填的,在没有这个 hook 函数时,一切正常。在有这个 hook 函数的时候,保存失败,返回错误信息:
是不是这块对于 Pointer 的处理可能有 bug,hook 函数返回的时候,不能正确读取 pointer 类型的字段?
The text was updated successfully, but these errors were encountered: