Skip to content

Commit 38b3dec

Browse files
loresusopoiana
authored andcommitted
update(pkg): let entryByName return a boolean value
Signed-off-by: Lorenzo Susini <[email protected]>
1 parent 59a3022 commit 38b3dec

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

pkg/index/index.go

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -93,8 +93,9 @@ func (i *Index) Remove(entry *Entry) error {
9393
}
9494

9595
// EntryByName returns a Entry by passing its name.
96-
func (i *Index) EntryByName(name string) *Entry {
97-
return i.entryByName[name]
96+
func (i *Index) EntryByName(name string) (*Entry, bool) {
97+
entry, ok := i.entryByName[name]
98+
return entry, ok
9899
}
99100

100101
// Normalize the index to the canonical form (i.e., entries sorted by name,

0 commit comments

Comments
 (0)