@@ -2,6 +2,7 @@ package gen
22
33import (
44 "bytes"
5+ "cmp"
56 "encoding/json"
67 "fmt"
78 "net/http"
@@ -256,7 +257,7 @@ func (g *Generator) mkInput(rule HTTPRule, m *protogen.Method, op *ogen.Operatio
256257 values := maps .Values (fields )
257258 // Sort to make output stable.
258259 slices .SortStableFunc (values , func (a , b * protogen.Field ) int {
259- return strings .Compare (string (a .Desc .FullName ()), string (b .Desc .FullName ()))
260+ return cmp .Compare (string (a .Desc .FullName ()), string (b .Desc .FullName ()))
260261 })
261262 if err := g .mkJSONFields (s , values ); err != nil {
262263 return "" , errors .Wrap (err , "make requestBody schema" )
@@ -296,9 +297,9 @@ func (g *Generator) mkInput(rule HTTPRule, m *protogen.Method, op *ogen.Operatio
296297 // Sort to make output stable.
297298 slices .SortStableFunc (op .Parameters , func (a , b * ogen.Parameter ) int {
298299 if a .In != b .In {
299- return strings .Compare (a .In , b .In )
300+ return cmp .Compare (a .In , b .In )
300301 }
301- return strings .Compare (a .Name , b .Name )
302+ return cmp .Compare (a .Name , b .Name )
302303 })
303304
304305 return tmpl .String (), nil
0 commit comments