MCPcopy Create free account
hub / github.com/cli/cli / unreferencedError

Function unreferencedError

pkg/cmd/issue/artifact/create/create.go:482–491  ·  view source on GitHub ↗

unreferencedError explains attached files that no document references, when there are several documents and none to append them to.

(paths []string)

Source from the content-addressed store, hash-verified

480// unreferencedError explains attached files that no document references,
481// when there are several documents and none to append them to.
482func 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.

Callers 1

attachFunction · 0.85

Calls 2

JoinMethod · 0.80
ErrorfMethod · 0.65

Tested by

no test coverage detected