A tour of go exercise Errors

hello I’m new to Go
can you tell me how to implement this exercise as the tutorial wants this the link of the exercise https://tour.golang.org/methods/20
and that is the link of my code https://play.golang.org/p/9xS2adKA0F

I think it does what the tutorial wants but I don’t think that this is the right way to do it so can you help me??

thanks in advance

You are supposed to implement a multireturning function as in the example code on the exercise page.

Return resilt, nil on ok and 0, ErrNegativeSqrt(input) on negative input.

This is a common pattern in go.

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.