MCPcopy Index your code
hub / github.com/google/go-github / addOperation

Function addOperation

tools/metadata/metadata.go:214–242  ·  view source on GitHub ↗
(ops []*operation, filename, opName, docURL string)

Source from the content-addressed store, hash-verified

212}
213
214func addOperation(ops []*operation, filename, opName, docURL string) []*operation {
215 for _, op := range ops {
216 if opName != op.Name {
217 continue
218 }
219 if len(op.OpenAPIFiles) == 0 {
220 op.OpenAPIFiles = append(op.OpenAPIFiles, filename)
221 op.DocumentationURL = docURL
222 return ops
223 }
224 // just append to files, but only add the first ghes file
225 if !strings.Contains(filename, "/ghes") {
226 op.OpenAPIFiles = append(op.OpenAPIFiles, filename)
227 return ops
228 }
229 for _, f := range op.OpenAPIFiles {
230 if strings.Contains(f, "/ghes") {
231 return ops
232 }
233 }
234 op.OpenAPIFiles = append(op.OpenAPIFiles, filename)
235 return ops
236 }
237 return append(ops, &operation{
238 Name: opName,
239 OpenAPIFiles: []string{filename},
240 DocumentationURL: docURL,
241 })
242}
243
244func unusedOps(opsFile *operationsFile, dir string) ([]*operation, error) {
245 var usedOps map[string]bool

Callers 1

getOpsFromGithubFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…