您最多能選擇 25 個主題
主題必須以字母或數字為開頭,可包含連接號「-」且最長為 35 個字元。
|
2 年前 | |
---|---|---|
.github/workflows | 2 年前 | |
cmd | ||
.gitignore | ||
.goreleaser.yml | ||
LICENSE | ||
README.md | 2 年前 | |
findup.go | 2 年前 | |
findup_test.go | 2 年前 | |
go.mod | ||
go.sum | 2 年前 |
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")