scopesEqual checks if two scope slices contain the same elements (order-independent)
(a, b []string)
| 302 | |
| 303 | // scopesEqual checks if two scope slices contain the same elements (order-independent) |
| 304 | func scopesEqual(a, b []string) bool { |
| 305 | if len(a) != len(b) { |
| 306 | return false |
| 307 | } |
| 308 | |
| 309 | // Create a map for quick lookup |
| 310 | aMap := make(map[string]bool, len(a)) |
| 311 | for _, scope := range a { |
| 312 | aMap[scope] = true |
| 313 | } |
| 314 | |
| 315 | // Check if all elements in b are in a |
| 316 | for _, scope := range b { |
| 317 | if !aMap[scope] { |
| 318 | return false |
| 319 | } |
| 320 | } |
| 321 | |
| 322 | return true |
| 323 | } |
| 324 | |
| 325 | // indentMultilineDescription adds the specified indent to all lines after the first line. |
| 326 | // This ensures that multi-line descriptions maintain proper markdown list formatting. |