-
-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #3 from gobuffalo/there
added there package
- Loading branch information
Showing
5 changed files
with
38 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
package there | ||
|
||
import "github.com/gobuffalo/here" | ||
|
||
var cache = here.New() | ||
|
||
// Dir attempts to gather info for the requested directory. | ||
// Results are cached globally inside the package. | ||
func Dir(p string) (here.Info, error) { | ||
return cache.Dir(p) | ||
} | ||
|
||
// Package attempts to gather info for the requested package. | ||
// | ||
// From the `go help list` docs: | ||
// The -find flag causes list to identify the named packages but not | ||
// resolve their dependencies: the Imports and Deps lists will be empty. | ||
// | ||
// A workaround for this issue is to use the `Dir` field in the | ||
// returned `Info` value and pass it to the `Dir(string) (Info, error)` | ||
// function to return the complete data. | ||
// Results are cached globally inside the package. | ||
func Package(p string) (here.Info, error) { | ||
return cache.Package(p) | ||
} | ||
|
||
// Results are cached globally inside the package. | ||
// Current returns the Info representing the current Go module | ||
func Current() (here.Info, error) { | ||
return cache.Current() | ||
} |