diff options
Diffstat (limited to 'repository/tree_entry.go')
-rw-r--r-- | repository/tree_entry.go | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/repository/tree_entry.go b/repository/tree_entry.go index 6c5ec1a5..9d70814c 100644 --- a/repository/tree_entry.go +++ b/repository/tree_entry.go @@ -100,3 +100,13 @@ func readTreeEntries(s string) ([]TreeEntry, error) { return casted, nil } + +// SearchTreeEntry search a TreeEntry by name from an array +func SearchTreeEntry(entries []TreeEntry, name string) (TreeEntry, bool) { + for _, entry := range entries { + if entry.Name == name { + return entry, true + } + } + return TreeEntry{}, false +} |