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
Does the ToStringE need to support this case and the library needs a fix, or I lust control my inputs ? I think It will be better to the function ToStringE accept any kind of inputs, it will be easier to use the function.
It seems there are only two cases of interface dereference:
case fmt.Stringer:
returns.String(), nil
case error:
returns.Error(), nil
So, a fix could be:
case fmt.Stringer:
ifs==nil {
return"", nil
}
returns.String(), nil
case error:
ifs==nil {
return"", nil
}
returns.Error(), nil
Note: I do not look for other cast function to search similar behavior.
The text was updated successfully, but these errors were encountered:
This code:
Produces a segfault.
I see in the
caste.go
file, functionToStringE
this line, which seems handle this case:Unfortunately, the nil case is not handled, and the nil *time.Time match the fmt.Stringer prototype. The result is a segfault.
To prevent this behaviour I control the input with this code:
Does the
ToStringE
need to support this case and the library needs a fix, or I lust control my inputs ? I think It will be better to the functionToStringE
accept any kind of inputs, it will be easier to use the function.It seems there are only two cases of interface dereference:
So, a fix could be:
Note: I do not look for other cast function to search similar behavior.
The text was updated successfully, but these errors were encountered: