mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-28 14:07:14 +00:00
Merge pull request #90353 from gaurav1086/protofuf_use_sort_Strings
[Protobuf] simplify sort expression
This commit is contained in:
commit
5555cc1cf9
@ -371,7 +371,7 @@ func (b bodyGen) doStruct(sw *generator.SnippetWriter) error {
|
|||||||
`, b.t)
|
`, b.t)
|
||||||
|
|
||||||
if len(options) > 0 {
|
if len(options) > 0 {
|
||||||
sort.Sort(sort.StringSlice(options))
|
sort.Strings(options)
|
||||||
for _, s := range options {
|
for _, s := range options {
|
||||||
fmt.Fprintf(out, " option %s;\n", s)
|
fmt.Fprintf(out, " option %s;\n", s)
|
||||||
}
|
}
|
||||||
@ -399,7 +399,7 @@ func (b bodyGen) doStruct(sw *generator.SnippetWriter) error {
|
|||||||
}
|
}
|
||||||
extras = append(extras, fmt.Sprintf("%s = %s", k, v))
|
extras = append(extras, fmt.Sprintf("%s = %s", k, v))
|
||||||
}
|
}
|
||||||
sort.Sort(sort.StringSlice(extras))
|
sort.Strings(extras)
|
||||||
if len(extras) > 0 {
|
if len(extras) > 0 {
|
||||||
fmt.Fprintf(out, " [")
|
fmt.Fprintf(out, " [")
|
||||||
fmt.Fprint(out, strings.Join(extras, ", "))
|
fmt.Fprint(out, strings.Join(extras, ", "))
|
||||||
|
Loading…
Reference in New Issue
Block a user