pkgs

package module
v0.0.0-...-726a3b2 Latest Latest
Warning

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

Go to latest
Published: Sep 9, 2013 License: BSD-2-Clause Imports: 4 Imported by: 0

README

go-pkgs

xrefs funcs top func library users

Package pkgs finds all packages in all of the GOPATH trees. It is library functionality equivalent to go list all (see go help packages for more info).

Much of the code was adapted from the cmd/go matchPackages func.

Docs: go-pkgs on Sourcegraph

Installation

go get github.com/sourcegraph/go-pkgs

Example Usage

import (
    "github.com/sourcegraph/go-pkgs"
    "go/build
)

// List all packages in all GOPATH trees.
pkglist, err := pkgs.FindAll("", build.Default, 0)

Documentation

Overview

Package pkgs finds all packages in all of the GOPATH trees. It is library functionality equivalent to `go list all` (see `go help packages` for more info).

Much of the code was adapted from the cmd/go matchPackages func.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FindAll

func FindAll(prefix string, buildContext build.Context, mode FindMode) (pkgs []*build.Package, err error)

FindAll returns a list of all packages in all of the GOPATH trees in the given build context. If prefix is non-empty, only packages whose import paths begin with prefix are returned.

Types

type FindMode

type FindMode uint
const (
	IncludeStdlib FindMode = 1 << iota
)

Jump to

Keyboard shortcuts

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