func (conf *Config) CreateFromFilenames(path string, filenames ...string) {
	conf.CreatePkgs = append(conf.CreatePkgs, PkgSpec{Path: path, Filenames: filenames})
}
CreateFromFilenames is a convenience function that adds
a conf.CreatePkgs entry to create a package of the specified *.go
files.
package loader
import (
	"errors"
	"fmt"
	"go/ast"
	"go/build"
	"go/parser"
	"go/token"
	"go/types"
	"os"
	"path/filepath"
	"sort"
	"strings"
	"sync"
	"time"
	"golang.org/x/tools/go/ast/astutil"
)
var ignoreVendor build.ImportMode
const trace = false  
type Config struct {
	Fset *token.FileSet
	ParserMode parser.Mode
	TypeChecker types.Config
	TypeCheckFuncBodies func(path string) bool
	Build *build.Context
	Cwd string
	DisplayPath func(path string) string
	AllowErrors bool
	CreatePkgs []PkgSpec
	ImportPkgs map[string]bool
	FindPackage func(ctxt *build.Context, importPath, fromDir string, mode build.ImportMode) (*build.Package, error)
	AfterTypeCheck func(info *PackageInfo, files []*ast.File)
}
type PkgSpec struct {
	Path      string       
	Files     []*ast.File  
	Filenames []string     
}
type Program struct {
	Fset *token.FileSet  
	Created []*PackageInfo
	Imported map[string]*PackageInfo
	AllPackages map[*types.Package]*PackageInfo
	importMap map[string]*types.Package
}
type PackageInfo struct {
	Pkg                   *types.Package
	Importable            bool         
	TransitivelyErrorFree bool         
	Files                 []*ast.File  
	Errors                []error      
	types.Info                         
	dir                   string       
	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.)
A '--' argument terminates the list of packages.
`
func (conf *Config) FromArgs(args []string, xtest bool) ([]string, error) {
	var rest []string
	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)
			}
		}
		conf.CreateFromFilenames("", args...)
	} else {
		for _, arg := range args {
			if xtest {
				conf.ImportWithTests(arg)
			} else {
				conf.Import(arg)
			}
		}
	}
	return rest, nil
}