Last active
March 12, 2019 07:36
-
-
Save draveness/2567fccb9ea5271aa0f5e0488bdf793c to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
errors.New("invalid parameter a") | |
errors.New("invalid parameter b") | |
errors.New("Record Not Found") |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var ErrRecordNotFound = errors.New("Record Not Found") | |
type ErrParam struct { | |
value string | |
} | |
func (e *ErrParam) Error() string { | |
return "invalid paramater " + e.value | |
} | |
func NewErrParam(value string) ErrParam { | |
return ErrParam{value: value} | |
} | |
NewErrParam("a") | |
NewErrParam("b") | |
ErrRecordNotFound |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment