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  
		}
	}
	if len(args) > 0 && strings.HasSuffix(args[0], ".go") {
		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 {
		for _, arg := range args {
			if xtest {
				err = conf.ImportWithTests(arg)
				if err != nil {
					break
				}
			} else {
				conf.Import(arg)
			}
		}
	}
	return
}
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.
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.
`