unreferencedError explains attached files that no document references, when there are several documents and none to append them to.
(paths []string)
| 480 | // unreferencedError explains attached files that no document references, |
| 481 | // when there are several documents and none to append them to. |
| 482 | func unreferencedError(paths []string) error { |
| 483 | if len(paths) == 1 { |
| 484 | return fmt.Errorf("no file references %s; reference it in a file, or attach it when creating a single artifact", paths[0]) |
| 485 | } |
| 486 | list := paths[0] + " or " + paths[1] |
| 487 | if len(paths) > 2 { |
| 488 | list = strings.Join(paths[:len(paths)-1], ", ") + ", or " + paths[len(paths)-1] |
| 489 | } |
| 490 | return fmt.Errorf("no file references %s; reference them in a file, or attach them when creating a single artifact", list) |
| 491 | } |
| 492 | |
| 493 | // createAction names an artifact in its failure line by what it was created |
| 494 | // from, or by its name when it came from --body. |