package
0.0.10
Repository: https://github.com/kingstonduy/go-core.git
Documentation: pkg.go.dev

# README

USAGE

1. Default errors
Error NameStatus (int)Error Code (string)Message
Success200 OK00Successful
Failed200 OK01Failed. %s
ValidationError200 OK02Validation error. %s
NotFoundError200 OK03Not found error. %s
OutboundError200 OK04Outbound error. %s
TimeoutError200 OK05Timeout error. %s
BadRequestError200 OK06Bad request error. %s
UnauthorizedError200 OK07Unauthorized error. %s
ForbiddenError200 OK08Forbidden error. %s
MethodNotAllowedError200 OK09Method not allowed error. %s
ConflictError200 OK10Conflict error. %s
TooManyRequestError200 OK11Too many request error. %s
InternalServerError500 Internal Server Error999Internal server error. %s
2. Create dynamic func error
	var (
		UserNotActive = NewError(400, "54", "User not active")
	)

	func UserNotFound(userId int) error {
		return NewError(400, "54", "User not found %d", userId)
	}