nil

Results 3 comments of nil

> 你好呀,Hi there, > > 希望你今天一切都好。Hope you are well today. > > 在这里完成了出色的工作,非常感谢!Great work done here, really appreciated! > > 想知道您是否可以添加一个关于如何在 GORM 中实现它的示例?Wondering if you could possibly add an example...

> Can you explain in more detail (ideally with some code examples)? From what I can tell this sounds like the expected behavior. Schema ```go field.Enum("gender").Optional().Nillable().Values("male", "female") ``` GenCode ```go...

> 这似乎是 Ent 的正确行为。调用的方法`String`应该返回`string`,没有`*string`很多其他代码依赖于这个约定。如果您愿意,您可以添加自己的方法`(Gender) NilString() *string`。 > > 但尚不清楚为什么您需要`*string`而不是`string`.如果您需要检查该值是否`nil`在服务器逻辑内部,您只需检查性别字段本身是否`nil`在,而不是转换`*string`为然后检查`nil`.如果您正在管理自己的 API(例如 REST API),那么您可以使用`omitempty`struct 标记。听起来这可能是 XY 问题。 > > `String`您需要返回的原因是什么`*string`? Gender is not a mandatory field, so I need the optional of...