miroir de https://github.com/ojizero/gofindup
Vous ne pouvez pas sélectionner plus de 25 sujets
Les noms de sujets doivent commencer par une lettre ou un nombre, peuvent contenir des tirets ('-') et peuvent comporter jusqu'à 35 caractères.
|
il y a 2 ans | |
---|---|---|
.github/workflows | il y a 2 ans | |
cmd | ||
.gitignore | ||
.goreleaser.yml | ||
LICENSE | ||
README.md | il y a 2 ans | |
findup.go | il y a 2 ans | |
findup_test.go | il y a 2 ans | |
go.mod | ||
go.sum | il y a 2 ans |
README.md
Go Find Up
Find a file or directory by walking up parent directories.
Usage
Install latest version
go get github.com/ojizero/gofindup
Import it into your code
import "github.com/ojizero/gofindup"
This package only exposes 2 functions, Findup
and FindupFrom
,
// looks the file recursively in parents starting from "./"
gofindup.Findup("some-file-or-directory")
// looks the file recursively in parents starting from "./some-starting-directory"
gofindup.FindupFrom("some-file-or-directory", "some-starting-directory")