Fix golint failures on handlers/negotiation

DefaultEndpointRestrictions is only used in the module,
so this renames it to defaultEndpointRestrictions.
This commit is contained in:
Kenichi Omichi
2019-01-18 22:06:48 +00:00
parent 21e3c15dfe
commit 302ec98591
3 changed files with 4 additions and 1 deletions

View File

@@ -531,7 +531,6 @@ staging/src/k8s.io/apiserver/pkg/endpoints
staging/src/k8s.io/apiserver/pkg/endpoints/discovery staging/src/k8s.io/apiserver/pkg/endpoints/discovery
staging/src/k8s.io/apiserver/pkg/endpoints/filters staging/src/k8s.io/apiserver/pkg/endpoints/filters
staging/src/k8s.io/apiserver/pkg/endpoints/handlers staging/src/k8s.io/apiserver/pkg/endpoints/handlers
staging/src/k8s.io/apiserver/pkg/endpoints/handlers/negotiation
staging/src/k8s.io/apiserver/pkg/endpoints/metrics staging/src/k8s.io/apiserver/pkg/endpoints/metrics
staging/src/k8s.io/apiserver/pkg/endpoints/openapi/testing staging/src/k8s.io/apiserver/pkg/endpoints/openapi/testing
staging/src/k8s.io/apiserver/pkg/endpoints/request staging/src/k8s.io/apiserver/pkg/endpoints/request

View File

@@ -29,6 +29,7 @@ type errNotAcceptable struct {
accepted []string accepted []string
} }
// NewNotAcceptableError returns an error of NotAcceptable which contains specified string
func NewNotAcceptableError(accepted []string) error { func NewNotAcceptableError(accepted []string) error {
return errNotAcceptable{accepted} return errNotAcceptable{accepted}
} }
@@ -51,6 +52,7 @@ type errUnsupportedMediaType struct {
accepted []string accepted []string
} }
// NewUnsupportedMediaTypeError returns an error of UnsupportedMediaType which contains specified string
func NewUnsupportedMediaTypeError(accepted []string) error { func NewUnsupportedMediaTypeError(accepted []string) error {
return errUnsupportedMediaType{accepted} return errUnsupportedMediaType{accepted}
} }

View File

@@ -133,6 +133,8 @@ type EndpointRestrictions interface {
AllowsStreamSchema(schema string) bool AllowsStreamSchema(schema string) bool
} }
// DefaultEndpointRestrictions is the default EndpointRestrictions which allows
// content-type negotiation to verify server support for specific options
var DefaultEndpointRestrictions = emptyEndpointRestrictions{} var DefaultEndpointRestrictions = emptyEndpointRestrictions{}
type emptyEndpointRestrictions struct{} type emptyEndpointRestrictions struct{}