You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
3. One of the nice things about Go is having a useful default zero-value for
43
+
every variable. This isn't the way nullable things work.
44
+
关于Go的一个好处是为每个变量提供了一个有用的默认零值。这不是可以为空的东西工作的方式。
36
45
37
46
If you need to define your own types to handle NULLs, you can copy the design of
38
47
`sql.NullString` to achieve that.
39
48
49
+
如果需要定义自己的类型来处理NULL,可以复制sql.NullString的设计来实现它。
50
+
40
51
If you can't avoid having NULL values in your database, there is another work around that most database systems support, namely `COALESCE()`. Something like the following might be something that you can use, without introducing a myriad of `sql.Null*` types.
0 commit comments