func ExampleConfig_CreateFromFilenames() {
	var conf loader.Config
	conf.CreateFromFilenames("math/cmplx",
		filepath.Join(runtime.GOROOT(), "src/math/cmplx/abs.go"),
		filepath.Join(runtime.GOROOT(), "src/math/cmplx/sin.go"))
	prog, err := conf.Load()
	if err != nil {
		log.Fatal(err)
	}
	printProgram(prog)
}
This example creates and type-checks a single package (without tests)
from a list of filenames, and loads all of its dependencies.
(The input files are actually only a small part of the math/cmplx package.)
package loader_test
import (
	"fmt"
	"go/token"
	"log"
	"path/filepath"
	"runtime"
	"sort"
	"strings"
	"golang.org/x/tools/go/loader"
)
func printProgram(prog *loader.Program) {
	var names []string
	for _, info := range prog.Created {
		names = append(names, info.Pkg.Path())
	}
	fmt.Printf("created: %s\n", names)
	names = nil
	for _, info := range prog.Imported {
		if strings.Contains(info.Pkg.Path(), "internal") {
			continue  
		}
		names = append(names, info.Pkg.Path())
	}
	sort.Strings(names)
	fmt.Printf("imported: %s\n", names)
	names = nil
	for _, info := range prog.InitialPackages() {
		names = append(names, info.Pkg.Path())
	}
	sort.Strings(names)
	fmt.Printf("initial: %s\n", names)
	names = nil
	for pkg := range prog.AllPackages {
		names = append(names, pkg.Path())
	}
	sort.Strings(names)
	fmt.Printf("all: %s\n", names)
}
func printFilenames(fset *token.FileSet, info *loader.PackageInfo) {
	var names []string
	for _, f := range info.Files {
		names = append(names, filepath.Base(fset.File(f.Pos()).Name()))
	}
	fmt.Printf("%s.Files: %s\n", info.Pkg.Path(), names)
}
func ExampleConfig_FromArgs() {
	args := []string{"mytool", "unicode/utf8", "errors", "runtime", "--", "foo", "bar"}
	const wantTests = false
	var conf loader.Config
	rest, err := conf.FromArgs(args[1:], wantTests)
	prog, err := conf.Load()
	if err != nil {
		log.Fatal(err)
	}
	fmt.Printf("rest: %s\n", rest)
	printProgram(prog)
}