You should user specified error types, instead of errors.New(...). It would make for much better error handling.
ie. instead of errors.New("No record found")
use:
type NoRecordError string
func (e NoRecordError) Error() string {
return "No record found"
}
You should user specified error types, instead of errors.New(...). It would make for much better error handling.
ie. instead of errors.New("No record found")
use:
type NoRecordError string
func (e NoRecordError) Error() string {
return "No record found"
}