This commit is contained in:
2026-08-17 02:12:17 +08:00
parent 560ae46b82
commit 6a05803e08
96 changed files with 2888 additions and 685 deletions
+5 -2
View File
@@ -71,7 +71,7 @@ func (s *APIService) Groups(ctx context.Context) ([]string, map[string]string, e
return nil, nil, err
}
seen := make(map[string]bool)
groups := make([]string, 0)
var groups []string
groupAPIMap := make(map[string]string)
for _, item := range items {
if !seen[item.APIGroup] {
@@ -126,7 +126,10 @@ func (s *APIService) PolicyPathResponses(ctx context.Context, authorityID uint)
if err != nil {
return nil, err
}
out := make([]dto.PolicyPathRequest, 0, len(items))
var out []dto.PolicyPathRequest
if len(items) > 0 {
out = make([]dto.PolicyPathRequest, 0, len(items))
}
for _, item := range items {
out = append(out, dto.PolicyPathRequest{Path: item.Path, Method: item.Method})
}