func (conf *Config) Import(path string) {
	if path == "unsafe" {
		return  
	}
	if conf.ImportPkgs == nil {
		conf.ImportPkgs = make(map[string]bool)
	}
	conf.ImportPkgs[path] = conf.ImportPkgs[path]  
}
Import is a convenience function that adds path to ImportPkgs, the
set of initial packages that will be imported from source.
package loader
import (
	"errors"
	"fmt"
	"go/ast"
	"go/build"
	"go/parser"
	"go/token"
	"os"
	"strings"
	"sync"
	"time"
	"github.com/mailgun/godebug/Godeps/_workspace/src/golang.org/x/tools/go/ast/astutil"
	"github.com/mailgun/godebug/Godeps/_workspace/src/golang.org/x/tools/go/gcimporter"
	"github.com/mailgun/godebug/Godeps/_workspace/src/golang.org/x/tools/go/types"
)
const trace = false  
type Config struct {
	Fset *token.FileSet
	ParserMode parser.Mode
	TypeChecker types.Config
	TypeCheckFuncBodies func(string) bool
	SourceImports bool
	Build *build.Context
	DisplayPath func(path string) string
	AllowErrors bool
	CreatePkgs []CreatePkg
	ImportPkgs map[string]bool
	PackageCreated func(*types.Package)
}
type CreatePkg struct {
	Path  string  
	Files []*ast.File
}
type Program struct {
	Fset *token.FileSet  
	Created []*PackageInfo
	Imported map[string]*PackageInfo
	ImportMap map[string]*types.Package
	AllPackages map[*types.Package]*PackageInfo
}
type PackageInfo struct {
	Pkg                   *types.Package
	Importable            bool         
	TransitivelyErrorFree bool         
	Files                 []*ast.File  
	Errors                []error      
	types.Info                         
	checker   *types.Checker  
	errorFunc func(error)
}
func (info *PackageInfo) String() string { return info.Pkg.Path() }
func (info *PackageInfo) appendError(err error) {
	if info.errorFunc != nil {
		info.errorFunc(err)
	} else {
		fmt.Fprintln(os.Stderr, err)
	}
	info.Errors = append(info.Errors, err)
}
func (conf *Config) fset() *token.FileSet {
	if conf.Fset == nil {
		conf.Fset = token.NewFileSet()
	}
	return conf.Fset
}
func (conf *Config) ParseFile(filename string, src interface{}) (*ast.File, error) {
	return parser.ParseFile(conf.fset(), filename, src, conf.ParserMode)
}
const FromArgsUsage = `
<args> is a list of arguments denoting a set of initial packages.
It may take one of two forms:
1. A list of *.go source files.
   All of the specified files are loaded, parsed and type-checked
   as a single package.  All the files must belong to the same directory.
2. A list of import paths, each denoting a package.
   The package's directory is found relative to the $GOROOT and
   $GOPATH using similar logic to 'go build', and the *.go files in
   that directory are loaded, parsed and type-checked as a single
   package.
   In addition, all *_test.go files in the directory are then loaded
   and parsed.  Those files whose package declaration equals that of
   the non-*_test.go files are included in the primary package.  Test
   files whose package declaration ends with "_test" are type-checked
   as another package, the 'external' test package, so that a single
   import path may denote two packages.  (Whether this behaviour is
   enabled is tool-specific, and may depend on additional flags.)
   Due to current limitations in the type-checker, only the first
   import path of the command line will contribute any tests.
A '--' argument terminates the list of packages.
`
// FromArgs interprets args as a set of initial packages to load from
// source and updates the configuration.  It returns the list of
// unconsumed arguments.
//
// It is intended for use in command-line interfaces that require a
// set of initial packages to be specified; see FromArgsUsage message
// for details.
//
func (conf *Config) FromArgs(args []string, xtest bool) (rest []string, err error) {
	for i, arg := range args {
		if arg == "--" {
			rest = args[i+1:]
			args = args[:i]
			break // consume "--" and return the remaining args
		}
	}
	if len(args) > 0 && strings.HasSuffix(args[0], ".go") {
		// Assume args is a list of a *.go files
		// denoting a single ad-hoc package.
		for _, arg := range args {
			if !strings.HasSuffix(arg, ".go") {
				return nil, fmt.Errorf("named files must be .go files: %s", arg)
			}
		}
		err = conf.CreateFromFilenames("", args...)
	} else {
		// Assume args are directories each denoting a
		// package and (perhaps) an external test, iff xtest.
		for _, arg := range args {
			if xtest {
				err = conf.ImportWithTests(arg)
				if err != nil {
					break
				}
			} else {
				conf.Import(arg)
			}
		}
	}
	return
}
// CreateFromFilenames is a convenience function that parses the
// specified *.go files and adds a package entry for them to
// conf.CreatePkgs.
//
// It fails if any file could not be loaded or parsed.
// TODO(adonovan): make it not return an error, by making CreatePkg
// store filenames and defer parsing until Load.
//
func (conf *Config) CreateFromFilenames(path string, filenames ...string) error {
	files, errs := parseFiles(conf.fset(), conf.build(), nil, ".", filenames, conf.ParserMode)
	if len(errs) > 0 {
		return errs[0]
	}
	conf.CreateFromFiles(path, files...)
	return nil
}
// CreateFromFiles is a convenience function that adds a CreatePkgs
// entry to create package of the specified path and parsed files.
//
// Precondition: conf.Fset is non-nil and was the fileset used to parse
// the files.  (e.g. the files came from conf.ParseFile().)
//
func (conf *Config) CreateFromFiles(path string, files ...*ast.File) {
	if conf.Fset == nil {
		panic("nil Fset")
	}
	conf.CreatePkgs = append(conf.CreatePkgs, CreatePkg{path, files})
}
// ImportWithTests is a convenience function that adds path to
// ImportPkgs, the set of initial source packages located relative to
// $GOPATH.  The package will be augmented by any *_test.go files in
// its directory that contain a "package x" (not "package x_test")
// declaration.
//
// In addition, if any *_test.go files contain a "package x_test"
// declaration, an additional package comprising just those files will
// be added to CreatePkgs.
//
func (conf *Config) ImportWithTests(path string) error {
	if path == "unsafe" {
		return nil // ignore; not a real package
	}
	conf.Import(path)
	// Load the external test package.
	bp, err := conf.findSourcePackage(path)
	if err != nil {
		return err // package not found
	}
	xtestFiles, errs := conf.parsePackageFiles(bp, 'x')
	if len(errs) > 0 {
		return errs[0]  
	}
	if len(xtestFiles) > 0 {
		conf.CreateFromFiles(path+"_test", xtestFiles...)
	}
	conf.ImportPkgs[path] = true
	return nil
}