Skip to content
/ findup Public

Find the first file matching in a current working directory or the nearest ancestor directory up to root using Go

License

Notifications You must be signed in to change notification settings

h2non/findup

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

21 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

findup.go Build Status GitHub release GoDoc

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

Installation

go get github.com/h2non/findup

Usage

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

Development

go test

License

MIT - Tomas Aparicio

About

Find the first file matching in a current working directory or the nearest ancestor directory up to root using Go

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages