From d4cbad8256db4dc6c7ac12a8b7b5b8fcd13a9a2e Mon Sep 17 00:00:00 2001 From: Mithun Singh Date: Fri, 6 Nov 2020 21:18:01 -0800 Subject: [PATCH] Fix go lint on folder apimachinery/pkg/runtime/serializer/protobuf --- hack/.golint_failures | 1 - .../apimachinery/pkg/runtime/serializer/protobuf/protobuf.go | 4 ++++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/hack/.golint_failures b/hack/.golint_failures index 85d4af8d0ac..58c16b6544a 100644 --- a/hack/.golint_failures +++ b/hack/.golint_failures @@ -252,7 +252,6 @@ staging/src/k8s.io/apimachinery/pkg/conversion staging/src/k8s.io/apimachinery/pkg/runtime staging/src/k8s.io/apimachinery/pkg/runtime/schema staging/src/k8s.io/apimachinery/pkg/runtime/serializer -staging/src/k8s.io/apimachinery/pkg/runtime/serializer/protobuf staging/src/k8s.io/apimachinery/pkg/runtime/serializer/recognizer staging/src/k8s.io/apimachinery/pkg/runtime/serializer/streaming staging/src/k8s.io/apimachinery/pkg/runtime/testing diff --git a/staging/src/k8s.io/apimachinery/pkg/runtime/serializer/protobuf/protobuf.go b/staging/src/k8s.io/apimachinery/pkg/runtime/serializer/protobuf/protobuf.go index f606b7d728b..404fb1b7e5f 100644 --- a/staging/src/k8s.io/apimachinery/pkg/runtime/serializer/protobuf/protobuf.go +++ b/staging/src/k8s.io/apimachinery/pkg/runtime/serializer/protobuf/protobuf.go @@ -61,6 +61,7 @@ func (e errNotMarshalable) Status() metav1.Status { } } +// IsNotMarshalable checks the type of error, returns a boolean true if error is not nil and not marshalable false otherwise func IsNotMarshalable(err error) bool { _, ok := err.(errNotMarshalable) return err != nil && ok @@ -77,6 +78,7 @@ func NewSerializer(creater runtime.ObjectCreater, typer runtime.ObjectTyper) *Se } } +// Serializer handles encoding versioned objects into the proper wire form type Serializer struct { prefix []byte creater runtime.ObjectCreater @@ -457,8 +459,10 @@ func (s *RawSerializer) Identifier() runtime.Identifier { return rawSerializerIdentifier } +// LengthDelimitedFramer is exported variable of type lengthDelimitedFramer var LengthDelimitedFramer = lengthDelimitedFramer{} +// Provides length delimited frame reader and writer methods type lengthDelimitedFramer struct{} // NewFrameWriter implements stream framing for this serializer