(ops []*operation, filename, opName, docURL string)
| 212 | } |
| 213 | |
| 214 | func 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 | |
| 244 | func unusedOps(opsFile *operationsFile, dir string) ([]*operation, error) { |
| 245 | var usedOps map[string]bool |
no outgoing calls
no test coverage detected
searching dependent graphs…