Skip to content

Commit 5555cc1

Browse files
authored
Merge pull request kubernetes#90353 from gaurav1086/protofuf_use_sort_Strings
[Protobuf] simplify sort expression
2 parents 863daa0 + 77c359f commit 5555cc1

File tree

1 file changed

+2
-2
lines changed
  • staging/src/k8s.io/code-generator/cmd/go-to-protobuf/protobuf

1 file changed

+2
-2
lines changed

staging/src/k8s.io/code-generator/cmd/go-to-protobuf/protobuf/generator.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -371,7 +371,7 @@ func (b bodyGen) doStruct(sw *generator.SnippetWriter) error {
371371
`, b.t)
372372

373373
if len(options) > 0 {
374-
sort.Sort(sort.StringSlice(options))
374+
sort.Strings(options)
375375
for _, s := range options {
376376
fmt.Fprintf(out, " option %s;\n", s)
377377
}
@@ -399,7 +399,7 @@ func (b bodyGen) doStruct(sw *generator.SnippetWriter) error {
399399
}
400400
extras = append(extras, fmt.Sprintf("%s = %s", k, v))
401401
}
402-
sort.Sort(sort.StringSlice(extras))
402+
sort.Strings(extras)
403403
if len(extras) > 0 {
404404
fmt.Fprintf(out, " [")
405405
fmt.Fprint(out, strings.Join(extras, ", "))

0 commit comments

Comments
 (0)