here – github.com/gobuffalo/here Index | Files | Directories

package here

import "github.com/gobuffalo/here"

Index

Variables

var Version = "development"

Version of here

Types

type Here

type Here struct {
	// contains filtered or unexported fields
}

func New

func New() Here

New returns a Here type that will cache all results. This speeds up repeated calls, and can be useful for testing.

func (Here) Current

func (h Here) Current() (Info, error)

Current returns the Info representing the current Go module

func (Here) Dir

func (h Here) Dir(p string) (Info, error)

Dir attempts to gather info for the requested directory.

func (Here) Package

func (h Here) Package(p string) (Info, error)

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.

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
}

Info represents details about the directory/package

func Current

func Current() (Info, error)

Current returns the Info representing the current Go module

func Dir

func Dir(p string) (Info, error)

Dir attempts to gather info for the requested directory.

func Package

func Package(p string) (Info, error)

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) IsZero

func (i Info) IsZero() bool

IsZero checks if the type has been filled with rich chocolately data goodness

func (Info) Parse

func (i Info) Parse(p string) (Path, error)

func (Info) String

func (i Info) String() string

type Module

type Module struct {
	Path      string
	Main      bool
	Dir       string
	GoMod     string
	GoVersion string
}

func (Module) IsZero

func (i Module) IsZero() bool

func (Module) String

func (i Module) String() string

type Path

type Path struct {
	Pkg  string
	Name string
}

func (Path) String

func (p Path) String() string

Source Files

current.go dir.go here.go info.go info_map.go module.go parse.go path.go pkg.go version.go

Directories

PathSynopsis
cmd
cmd/here
there
Version
v0.6.7 (latest)
Published
Sep 3, 2022
Platform
js/wasm
Imports
9 packages
Last checked
now

Tools for package owners.