forked from guregu/null
-
Notifications
You must be signed in to change notification settings - Fork 36
Open
Description
shouldn't the default behaviour of StringFrom called with an empty string result in Valid == false
So the code would look something like this:
func StringFrom(s string) String {
valid := len(s) > 0
return NewString(s, valid)
}No hard opinion here and we will probably not change this, as this would be a breaking change especially for sqlboiler, just wondering what the reason behind this decision is. Currently this leads to nullable strings on the DB are set per default to
an empty string instead of null, when passing values from an API model with omitempty
Metadata
Metadata
Assignees
Labels
No labels