package here

import "github.com/markbates/pkger/here"

Index

Functions

func ClearCache

func ClearCache()

Types

type Info

type Info struct {
	Dir        string
	ImportPath string
	Name       string
	Module     Module
}

Info represents details about the directory/package

func Cache

func Cache(p string, fn func(string) (Info, error)) (Info, error)

func Current

func Current() (Info, error)

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

func (i Info) MarshalJSON() ([]byte, error)

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
v0.12.2
Published
Nov 11, 2019
Platform
js/wasm
Imports
10 packages
Last checked
9 hours ago

Tools for package owners.