gotool

package module
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Feb 21, 2018 License: MIT Imports: 3 Imported by: 426 modules, 953 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

README

gotool

GoDoc Build Status

Package gotool contains utility functions used to implement the standard "cmd/go" tool, provided as a convenience to developers who want to write tools with similar semantics.

Documentation

Overview

Package gotool contains utility functions used to implement the standard "cmd/go" tool, provided as a convenience to developers who want to write tools with similar semantics.

Index

Constants

This section is empty.

Variables

View Source
var DefaultContext = Context{
	BuildContext: build.Default,
}

DefaultContext is the default context that uses build.Default.

Functions

func ImportPaths

func ImportPaths(args []string) []string

ImportPaths returns the import paths to use for the given command line using default context.

The path "all" is expanded to all packages in $GOPATH and $GOROOT. The path "std" is expanded to all packages in the Go standard library. The path "cmd" is expanded to all Go standard commands. The string "..." is treated as a wildcard within a path. When matching recursively, directories are ignored if they are prefixed with a dot or an underscore (such as ".foo" or "_foo"), or are named "testdata". Relative import paths are not converted to full import paths. If args is empty, a single element "." is returned.

Types

type Context

type Context struct {
	// BuildContext is the build.Context that is used when computing import paths.
	BuildContext build.Context
}

A Context specifies the supporting context.

func (*Context) ImportPaths

func (c *Context) ImportPaths(args []string) []string

ImportPaths returns the import paths to use for the given command line.

The path "all" is expanded to all packages in $GOPATH and $GOROOT. The path "std" is expanded to all packages in the Go standard library. The path "cmd" is expanded to all Go standard commands. The string "..." is treated as a wildcard within a path. When matching recursively, directories are ignored if they are prefixed with a dot or an underscore (such as ".foo" or "_foo"), or are named "testdata". Relative import paths are not converted to full import paths. If args is empty, a single element "." is returned.

Directories

Path Synopsis
internal
load
Package load loads packages.
Package load loads packages.

Jump to

Keyboard shortcuts

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