here

package
v0.12.4 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 17, 2019 License: MIT Imports: 10 Imported by: 19

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ClearCache added in v0.11.0

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

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL