https://github.com/integralist/go-findroot
Locate the root directory of a project using Git via the command line
https://github.com/integralist/go-findroot
Last synced: over 1 year ago
JSON representation
Locate the root directory of a project using Git via the command line
- Host: GitHub
- URL: https://github.com/integralist/go-findroot
- Owner: Integralist
- License: mit
- Created: 2016-05-18T10:44:43.000Z (about 10 years ago)
- Default Branch: master
- Last Pushed: 2016-05-18T11:48:14.000Z (about 10 years ago)
- Last Synced: 2025-03-01T01:32:09.625Z (over 1 year ago)
- Language: Go
- Size: 1.95 KB
- Stars: 17
- Watchers: 2
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
go-findroot
Locate the root directory of a project using Git via the command line
## Example
```go
package main
import (
"fmt"
"log"
"github.com/integralist/go-findroot/find"
)
func main() {
root, err := find.Repo()
if err != nil {
log.Fatalf("Error: %s", err.Error())
}
fmt.Printf("%+v", root)
// {Name:go-findroot Path:/Users/M/Projects/golang/src/github.com/integralist/go-findroot}
}
```
## Tests
```go
go test -v ./...
```
## Licence
[The MIT License (MIT)](http://opensource.org/licenses/MIT)
Copyright (c) 2016 [Mark McDonnell](http://twitter.com/integralist)