Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/h2non/findup
Find the first file matching in a current working directory or the nearest ancestor directory up to root using Go
https://github.com/h2non/findup
Last synced: 17 days ago
JSON representation
Find the first file matching in a current working directory or the nearest ancestor directory up to root using Go
- Host: GitHub
- URL: https://github.com/h2non/findup
- Owner: h2non
- License: mit
- Created: 2014-12-13T20:58:58.000Z (almost 10 years ago)
- Default Branch: master
- Last Pushed: 2021-10-25T13:09:52.000Z (about 3 years ago)
- Last Synced: 2024-10-07T17:41:14.463Z (27 days ago)
- Language: Go
- Homepage:
- Size: 8.79 KB
- Stars: 9
- Watchers: 4
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# findup.go [![Build Status](https://travis-ci.org/h2non/findup.png)](https://travis-ci.org/h2non/findup) [![GitHub release](https://img.shields.io/github/tag/h2non/findup.svg)]() [![GoDoc](https://godoc.org/github.com/h2non/findup?status.png)](https://godoc.org/github.com/h2non/findup)
A [Go](http://golang.org) tiny package to **find the first file matching** in the current directory or the nearest ancestor directory up to root, with additional [Glob patterns](http://en.wikipedia.org/wiki/Glob_%28programming%29) support. Inspired in [node's findup](https://www.npmjs.com/package/findup)
It works in Go >= 1.1. See Travis [builds](https://travis-ci.org/h2non/findup)
## Installation
```bash
go get github.com/h2non/findup
```## Usage
Import the package
```go
import "github.com/h2non/findup"
```Find a file
```go
path, err := findup.Find("findup.go")
fmt.Println(path) // -> /full/path/to/findup.go
```Find a file using a Glob pattern
```go
path, err := findup.Find("findup.*")
fmt.Println(path) // -> /full/path/to/findup.go
```Detailed API documentation is available via [GoDoc](https://godoc.org/github.com/h2non/findup)
## Development
```bash
go test
```## License
MIT - Tomas Aparicio