Locate the root directory of a project using Git via the command line
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
find
LICENSE
README.md

README.md

go-findroot

Locate the root directory of a project using Git via the command line

Example

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 test -v ./...

Licence

The MIT License (MIT)

Copyright (c) 2016 Mark McDonnell