The method _____ should be defined to return the error message for a custom error.

  • ErrorMessage
  • Message
  • GetError
  • ErrorText
The method that should be defined to return the error message for a custom error is Error() string. When implementing the error interface in Go, you must define the Error() method, which returns a string representing the error message. This method is called whenever an error is converted to a string, allowing you to customize the error message for your custom error type.
Add your answer
Loading...

Leave a comment

Your email address will not be published. Required fields are marked *