mirror of
https://github.com/go-kratos/kratos.git
synced 2025-03-17 21:07:54 +02:00
fix(metadata): sort services by lexicographical order on ListServices (#2397)
Co-authored-by: Guoqiang Ding <guoqiang10@staff.sina.com.cn>
This commit is contained in:
parent
6bb3ad6f27
commit
40300677ee
@ -7,6 +7,7 @@ import (
|
||||
"errors"
|
||||
"fmt"
|
||||
"io"
|
||||
"sort"
|
||||
"sync"
|
||||
|
||||
"google.golang.org/grpc"
|
||||
@ -115,6 +116,8 @@ func (s *Server) ListServices(ctx context.Context, in *ListServicesRequest) (*Li
|
||||
reply.Methods = append(reply.Methods, fmt.Sprintf("/%s/%s", name, method))
|
||||
}
|
||||
}
|
||||
sort.Strings(reply.Services)
|
||||
sort.Strings(reply.Methods)
|
||||
return reply, nil
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user