package here
import "github.com/gobuffalo/here"
Index ¶
- Constants
- type Info
- func Dir(p string) (Info, error)
- func Package(p string) (Info, error)
- func (i Info) Getenv(k string) string
- func (i Info) GoPath() string
- func (i Info) Has(k string) bool
- func (i Info) IsZero() bool
- func (i Info) Mods() bool
- func (i Info) ModuleName() string
- func (i Info) String() string
- type Module
Constants ¶
const Version = "v0.1.1"
Version of here
Types ¶
type Info ¶
type Info struct {
Dir string
ImportPath string
Name string
Doc string
Target string
Root string
Match []string
Stale bool
StaleReason string
GoFiles []string
Imports []string
Deps []string
TestGoFiles []string
TestImports []string
Module Module
GoEnv map[string]string // go env -json
}
Info represents details about the directory/package
func Dir ¶
Dir attempts to gather info for the requested directory.
func Package ¶
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.
func (Info) Getenv ¶
Getenv is a helper function to mimic os.Getenv behavior.
func (Info) GoPath ¶
GoPath returns the GOPATH ENV var
func (Info) Has ¶
Has checks if the ENV variable is in the GoEnv
func (Info) IsZero ¶
IsZero checks if the type has been filled with rich chocolately data goodness
func (Info) Mods ¶
Mods returns whether Go modules are used in this directory/package.
func (Info) ModuleName ¶
ModuleName returns the name of the current module, or if not using modules, the current package. These *might* not match.
func (Info) String ¶
type Module ¶
type Module struct {
Path string `json:"Path"`
Main bool `json:"Main"`
Dir string `json:"Dir"`
GoMod string `json:"GoMod"`
GoVersion string `json:"GoVersion"`
}
func (Module) IsZero ¶
func (Module) String ¶
Source Files ¶
dir.go here.go info.go module.go pkg.go version.go
Directories ¶
| Path | Synopsis |
|---|---|
| cmd | |
| cmd/here |
- Version
- v0.1.1
- Published
- Jun 15, 2019
- Platform
- windows/amd64
- Imports
- 5 packages
- Last checked
- 11 months ago –
Tools for package owners.