context

package
v0.0.0-...-ee6dd69 Latest Latest
Warning

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

Go to latest
Published: Dec 8, 2017 License: GPL-3.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetPackagePaths

func GetPackagePaths(pkgpath string) ([]string, error)

GetPackagePaths get all import path prefixed with input

func GofmtPath

func GofmtPath() string

GofmtPath return gofmt application file path

Types

type Context

type Context struct {
	GopathList []string // List of GOPATHs in environment. Includes "src" dir.
	Goroot     string   // The path to the standard library.
	GoEnv      map[string]string

	// Packages is list of need handle package
	Packages []*build.Package
}

Context represents the current project context.

func New

func New() (*Context, error)

New create a new context.

func (*Context) FindImportPath

func (ctx *Context) FindImportPath(dir string) (importPath, gopath string, err error)

FindImportPath takes a absolute directory and returns the import path and go path.

Jump to

Keyboard shortcuts

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