From 9536561e599eb7eb56204a584098b85e48196050 Mon Sep 17 00:00:00 2001 From: aaa <1693291525@qq.com> Date: Sat, 20 Apr 2019 15:12:48 -0400 Subject: [PATCH] Using var() block to define variables --- pkg/api/legacyscheme/scheme.go | 22 ++++++++++++---------- 1 file changed, 12 insertions(+), 10 deletions(-) diff --git a/pkg/api/legacyscheme/scheme.go b/pkg/api/legacyscheme/scheme.go index acfcc8f8efa..f9baf7a012a 100644 --- a/pkg/api/legacyscheme/scheme.go +++ b/pkg/api/legacyscheme/scheme.go @@ -21,15 +21,17 @@ import ( "k8s.io/apimachinery/pkg/runtime/serializer" ) -// Scheme is the default instance of runtime.Scheme to which types in the Kubernetes API are already registered. -// NOTE: If you are copying this file to start a new api group, STOP! Copy the -// extensions group instead. This Scheme is special and should appear ONLY in -// the api group, unless you really know what you're doing. -// TODO(lavalamp): make the above error impossible. -var Scheme = runtime.NewScheme() +var ( + // Scheme is the default instance of runtime.Scheme to which types in the Kubernetes API are already registered. + // NOTE: If you are copying this file to start a new api group, STOP! Copy the + // extensions group instead. This Scheme is special and should appear ONLY in + // the api group, unless you really know what you're doing. + // TODO(lavalamp): make the above error impossible. + Scheme = runtime.NewScheme() -// Codecs provides access to encoding and decoding for the scheme -var Codecs = serializer.NewCodecFactory(Scheme) + // Codecs provides access to encoding and decoding for the scheme + Codecs = serializer.NewCodecFactory(Scheme) -// ParameterCodec handles versioning of objects that are converted to query parameters. -var ParameterCodec = runtime.NewParameterCodec(Scheme) + // ParameterCodec handles versioning of objects that are converted to query parameters. + ParameterCodec = runtime.NewParameterCodec(Scheme) +)