19 lines
290 B
Go
19 lines
290 B
Go
package domain
|
|
|
|
import "path"
|
|
|
|
// TODO(toby3d): search by type or name/id.
|
|
type Files []*File
|
|
|
|
func (f Files) GetMatch(pattern string) *File {
|
|
for i := range f {
|
|
if matched, err := path.Match(pattern, f[i].Path); err != nil || !matched {
|
|
continue
|
|
}
|
|
|
|
return f[i]
|
|
}
|
|
|
|
return nil
|
|
}
|