Merge pull request #42781 from spzala/conversionlint
Automatic merge from submit-queue Conversionlint **What this PR does / why we need it**: This PR adds a comment placeholder for the exported or public functions in conversion generator files. Such functions without a comment results into golint failure in various generated files. The changes in this patch takes care of about 36 related lint failures. Given below is an example lint error, zz_generated.conversion.go:91:1: exported function Convert_v1alpha1_Binding_To_servicecatalog_Binding should have comment or be unexported **Which issue this PR fixes** *(optional, in `fixes #<issue number>(, fixes #<issue_number>, ...)` format, will close that issue when PR gets merged)*: fixes # Considering minor changes no issue is created. **Special notes for your reviewer**: Hello, I am trying to fix golint failures as we see them in the kubernetes-incubator/service-catalog project. I have separate PRs opened for lint issues related to other generator code which are in separate libraries like gengo. Thanks! **Release note**: ```release-note ```
This commit is contained in:
@@ -580,6 +580,7 @@ func (g *genConversion) generateConversion(inType, outType *types.Type, sw *gene
|
||||
}
|
||||
} else {
|
||||
// Emit a public conversion function.
|
||||
sw.Do("// "+nameTmpl+" is an autogenerated conversion function.\n", args)
|
||||
sw.Do("func "+nameTmpl+"(in *$.inType|raw$, out *$.outType|raw$, s $.Scope|raw$) error {\n", args)
|
||||
sw.Do("return auto"+nameTmpl+"(in, out, s)\n", args)
|
||||
sw.Do("}\n\n", nil)
|
||||
|
||||
Reference in New Issue
Block a user