(paths []string)
| 363 | } |
| 364 | |
| 365 | func (r *SpecReader) initialize(paths []string) error { |
| 366 | for _, path := range paths { |
| 367 | file, err := os.Open(path) |
| 368 | if err != nil { |
| 369 | return err |
| 370 | } |
| 371 | fileInfo, err := file.Stat() |
| 372 | if err != nil { |
| 373 | file.Close() |
| 374 | return err |
| 375 | } |
| 376 | file.Close() |
| 377 | if fileInfo.IsDir() { |
| 378 | if err := r.loadSpecsFromDir(path); err != nil { |
| 379 | return err |
| 380 | } |
| 381 | } else { |
| 382 | if err := r.loadSpecsFromFile(path); err != nil { |
| 383 | return err |
| 384 | } |
| 385 | } |
| 386 | } |
| 387 | |
| 388 | return nil |
| 389 | } |
| 390 | |
| 391 | // strip yaml comments from the given yaml document by converting to JSON and back :) |
| 392 | func stripYamlComments(b []byte) ([]byte, error) { |
no test coverage detected