From 538ceee47b9e4e4023f04f89e749d940c38ea9a7 Mon Sep 17 00:00:00 2001 From: Kenichi Omichi Date: Fri, 18 Jan 2019 22:06:48 +0000 Subject: [PATCH] Fix golint failures on handlers/negotiation DefaultEndpointRestrictions is only used in the module, so this renames it to defaultEndpointRestrictions. Kubernetes-commit: 302ec9859113f322a32ed03673865b32ca5a130a --- pkg/endpoints/handlers/negotiation/errors.go | 2 ++ pkg/endpoints/handlers/negotiation/negotiate.go | 2 ++ 2 files changed, 4 insertions(+) diff --git a/pkg/endpoints/handlers/negotiation/errors.go b/pkg/endpoints/handlers/negotiation/errors.go index 93b17cfb0..9a38abddb 100644 --- a/pkg/endpoints/handlers/negotiation/errors.go +++ b/pkg/endpoints/handlers/negotiation/errors.go @@ -29,6 +29,7 @@ type errNotAcceptable struct { accepted []string } +// NewNotAcceptableError returns an error of NotAcceptable which contains specified string func NewNotAcceptableError(accepted []string) error { return errNotAcceptable{accepted} } @@ -51,6 +52,7 @@ type errUnsupportedMediaType struct { accepted []string } +// NewUnsupportedMediaTypeError returns an error of UnsupportedMediaType which contains specified string func NewUnsupportedMediaTypeError(accepted []string) error { return errUnsupportedMediaType{accepted} } diff --git a/pkg/endpoints/handlers/negotiation/negotiate.go b/pkg/endpoints/handlers/negotiation/negotiate.go index 7aadce734..ec8861cc6 100644 --- a/pkg/endpoints/handlers/negotiation/negotiate.go +++ b/pkg/endpoints/handlers/negotiation/negotiate.go @@ -133,6 +133,8 @@ type EndpointRestrictions interface { AllowsStreamSchema(schema string) bool } +// DefaultEndpointRestrictions is the default EndpointRestrictions which allows +// content-type negotiation to verify server support for specific options var DefaultEndpointRestrictions = emptyEndpointRestrictions{} type emptyEndpointRestrictions struct{}