MCPcopy Index your code
hub / github.com/github/github-mcp-server / scopesEqual

Function scopesEqual

cmd/github-mcp-server/generate_docs.go:304–323  ·  view source on GitHub ↗

scopesEqual checks if two scope slices contain the same elements (order-independent)

(a, b []string)

Source from the content-addressed store, hash-verified

302
303// scopesEqual checks if two scope slices contain the same elements (order-independent)
304func 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.

Callers 1

writeToolDocFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected