3 ms·
result, err := x / y if err != nil { do something }
by jrockway 12y ago
result, err := x / y
if err != nil {
do something
}
- Riesling 12y agoSince you are using go syntax... I don't think that this will work in go, because division by zero will cause the function to panic.
- jrockway 12y agoActually, it doesn't even compile in go, because / doesn't return two arguments. But he's writing his own language, not using go, so this limitation need not apply.