Skip to content

Commit

Permalink
fix: mandates empty referrer to empty array (#729)
Browse files Browse the repository at this point in the history
Resolves: #728
Signed-off-by: Billy Zha <[email protected]>
  • Loading branch information
qweeah authored Dec 20, 2022
1 parent a671c16 commit 42f62e0
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion cmd/oras/discover.go
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ func runDiscover(opts discoverOptions) error {
}

func fetchReferrers(ctx context.Context, repo *remote.Repository, desc ocispec.Descriptor, artifactType string) ([]ocispec.Descriptor, error) {
var results []ocispec.Descriptor
results := []ocispec.Descriptor{}
err := repo.Referrers(ctx, desc, artifactType, func(referrers []ocispec.Descriptor) error {
results = append(results, referrers...)
return nil
Expand Down

0 comments on commit 42f62e0

Please sign in to comment.