From 4e09e1b6589cc362e2c96857447d4226416c1573 Mon Sep 17 00:00:00 2001 From: Antonio Murdaca Date: Wed, 8 Jun 2016 10:19:15 +0200 Subject: [PATCH] registry: use const for status code 429 Signed-off-by: Antonio Murdaca --- docs/api/errcode/register.go | 5 +---- docs/client/errors.go | 5 +---- 2 files changed, 2 insertions(+), 8 deletions(-) diff --git a/docs/api/errcode/register.go b/docs/api/errcode/register.go index 7489e84f..71cf6f7a 100644 --- a/docs/api/errcode/register.go +++ b/docs/api/errcode/register.go @@ -71,10 +71,7 @@ var ( Message: "too many requests", Description: `Returned when a client attempts to contact a service too many times`, - // FIXME: go1.5 doesn't export http.StatusTooManyRequests while - // go1.6 does. Update the hardcoded value to the constant once - // Docker updates golang version to 1.6. - HTTPStatusCode: 429, + HTTPStatusCode: http.StatusTooManyRequests, }) ) diff --git a/docs/client/errors.go b/docs/client/errors.go index adbaacf4..804e69e0 100644 --- a/docs/client/errors.go +++ b/docs/client/errors.go @@ -54,10 +54,7 @@ func parseHTTPErrorResponse(statusCode int, r io.Reader) error { switch statusCode { case http.StatusUnauthorized: return errcode.ErrorCodeUnauthorized.WithMessage(detailsErr.Details) - // FIXME: go1.5 doesn't export http.StatusTooManyRequests while - // go1.6 does. Update the hardcoded value to the constant once - // Docker updates golang version to 1.6. - case 429: + case http.StatusTooManyRequests: return errcode.ErrorCodeTooManyRequests.WithMessage(detailsErr.Details) default: return errcode.ErrorCodeUnknown.WithMessage(detailsErr.Details)