1
0
mirror of https://github.com/kidoman/embd synced 2024-05-28 06:40:06 +02:00
embd/utils.go
Karan Misra c35deeb17c host specific drivers can now be loaded separately
this ensures cleaner abstractions/code and will ensure that the produced
binary is as small as possible. a convenience package is provided to
easily load all hosts easily: "github.com/kidoman/embd/host/all"
2014-04-06 06:50:09 +05:30

17 lines
386 B
Go

package embd
import "path/filepath"
// FindFirstMatchingFile finds the first glob match in the filesystem.
// Inspiration: https://github.com/mrmorphic/hwio/blob/master/hwio.go#L451
func FindFirstMatchingFile(glob string) (string, error) {
matches, err := filepath.Glob(glob)
if err != nil {
return "", err
}
if len(matches) >= 1 {
return matches[0], nil
}
return "", nil
}