From 7f8910f793ecb27c4e942aa1c26047e8c93bea42 Mon Sep 17 00:00:00 2001 From: xdrm-brackets Date: Sun, 20 May 2018 10:41:17 +0200 Subject: [PATCH] error: prefix 'Err' to be namespaceless --- errors.go | 38 +++++++++++++++++++------------------- 1 file changed, 19 insertions(+), 19 deletions(-) diff --git a/errors.go b/errors.go index f913d2e..871ed8e 100644 --- a/errors.go +++ b/errors.go @@ -13,35 +13,35 @@ type Err struct { var ( /* Base */ - Success = &Err{0, "all right", nil} - Failure = &Err{1, "it failed", nil} - Unknown = &Err{-1, "", nil} + ErrSuccess = &Err{0, "all right", nil} + ErrFailure = &Err{1, "it failed", nil} + ErrUnknown = &Err{-1, "", nil} - NoMatchFound = &Err{2, "no resource found", nil} - AlreadyExists = &Err{3, "resource already exists", nil} + ErrNoMatchFound = &Err{2, "no resource found", nil} + ErrAlreadyExists = &Err{3, "resource already exists", nil} - Config = &Err{4, "configuration error", nil} + ErrConfig = &Err{4, "configuration error", nil} /* I/O */ - UploadError = &Err{100, "upload failed", nil} - DownloadError = &Err{101, "download failed", nil} - MissingDownloadHeaders = &Err{102, "download headers are missing", nil} - MissingDownloadBody = &Err{103, "download body is missing", nil} + ErrUpload = &Err{100, "upload failed", nil} + ErrDownload = &Err{101, "download failed", nil} + ErrMissingDownloadHeaders = &Err{102, "download headers are missing", nil} + ErrMissingDownloadBody = &Err{103, "download body is missing", nil} /* Controllers */ - UnknownController = &Err{200, "unknown controller", nil} - UnknownMethod = &Err{201, "unknown method", nil} - UncallableController = &Err{202, "uncallable controller", nil} - UncallableMethod = &Err{203, "uncallable method", nil} + ErrUnknownController = &Err{200, "unknown controller", nil} + ErrUnknownMethod = &Err{201, "unknown method", nil} + ErrUncallableController = &Err{202, "uncallable controller", nil} + ErrUncallableMethod = &Err{203, "uncallable method", nil} /* Permissions */ - Permission = &Err{300, "permission error", nil} - Token = &Err{301, "token error", nil} + ErrPermission = &Err{300, "permission error", nil} + ErrToken = &Err{301, "token error", nil} /* Check */ - MissingParam = &Err{400, "missing parameter", nil} - InvalidParam = &Err{401, "invalid parameter", nil} - InvalidDefaultParam = &Err{402, "invalid default param", nil} + ErrMissingParam = &Err{400, "missing parameter", nil} + ErrInvalidParam = &Err{401, "invalid parameter", nil} + ErrInvalidDefaultParam = &Err{402, "invalid default param", nil} ) // BindArgument adds an argument to the error