func TestAll(t *testing.T, f func(*testing.T, Exporter)) {
	t.Helper()
	for _, e := range All {
		t.Run(e.Name(), func(t *testing.T) {
			t.Helper()
			f(t, e)
		})
	}
}
TestAll invokes the testing function once for each exporter registered in
the All global.
Each exporter will be run as a sub-test named after the exporter being used.
package packagestest
import (
	"flag"
	"fmt"
	"go/token"
	"io/ioutil"
	"log"
	"os"
	"path/filepath"
	"strings"
	"testing"
	"golang.org/x/tools/go/expect"
	"golang.org/x/tools/go/packages"
	"golang.org/x/tools/internal/span"
	"golang.org/x/tools/internal/testenv"
)
var (
	skipCleanup = flag.Bool("skip-cleanup", false, "Do not delete the temporary export folders")  
)
type Module struct {
	Name string
	Files map[string]interface{}
	Overlay map[string][]byte
}
type Writer func(filename string) error
type Exported struct {
	Config *packages.Config
	Modules []Module
	ExpectFileSet *token.FileSet  
	Exporter Exporter                      
	temp     string                        
	primary  string                        
	written  map[string]map[string]string  
	notes    []*expect.Note                
	markers  map[string]span.Range         
}
type Exporter interface {
	Name() string
	Filename(exported *Exported, module, fragment string) string
	Finalize(exported *Exported) error
}
var All []Exporter