A Go tiny package to find the first file matching in the current directory or the nearest ancestor directory up to root, with additional Glob patterns support. Inspired in node's findup
It works in Go >= 1.1. See Travis builds
go get github.com/h2non/findup
Import the package
import "github.com/h2non/findup"
Find a file
path, err := findup.Find("findup.go")
fmt.Println(path) // -> /full/path/to/findup.go
Find a file using a Glob pattern
path, err := findup.Find("findup.*")
fmt.Println(path) // -> /full/path/to/findup.go
Detailed API documentation is available via GoDoc
go test
MIT - Tomas Aparicio