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
{{ message }}
This repository was archived by the owner on Nov 6, 2021. It is now read-only.
B1nj0y edited this page Oct 13, 2017
·
18 revisions
Rails is easy with database nullable fields, it return a nil if the field is NULL. It's idomatic and transparent for developers.
But Go is a typed language, if you set a struct attribute as string, then you can't evaluate it as nil. Here's is a post for the situation: working-with-db-nulls.
Zero values
Go hasn't a nil for its basic types, but it provides zero values for them: