func NewTemporaryWithFiles(prefix string, files []SourceFile) (*Temporary, error) {
	dir, err := ioutil.TempDir("", prefix)
	if err != nil {
		return nil, err
	}
	t, err := NewTemporary(dir, true)
	if err != nil {
		os.RemoveAll(dir)
		return nil, err
	}
	t.deleteDir = true
	if err := t.Copy(files); err != nil {
		t.Reset()
		return nil, err
	}
	return t, nil
}
// NewTemporaryWithFiles creates a temporary go source tree after copying/creating files.
// prefix is used to create a temporary directory in which the source tree is created.
NewTemporaryWithFiles creates a temporary go source tree after copying/creating files.
prefix is used to create a temporary directory in which the source tree is created.
// NewTemporaryWithFiles creates a temporary go source tree after copying / creating files . // prefix is used to create a temporary directory in which the source tree is created .
func NewTemporaryWithFiles(prefix string, files []SourceFile) (*Temporary, error) {
	dir, err := ioutil.TempDir("", prefix)
	if err != nil {
		return nil, err
	}
	t, err := NewTemporary(dir, true)
	if err != nil {
		os.RemoveAll(dir)
		return nil, err
	}
	t.deleteDir = true
	if err := t.Copy(files); err != nil {
		t.Reset()
		return nil, err
	}
	return t, nil
}
func NewTemporaryWithFiles ( prefix string , files [ ] SourceFile ) ( * Temporary , error ) { dir , err := ioutil . TempDir ( " " , prefix ) if err != nil { return nil , err } t , err := NewTemporary ( dir , true ) if err != nil { os . RemoveAll ( dir ) return nil , err } t . deleteDir = true if err := t . Copy ( files ) ; err != nil { t . Reset ( ) return nil , err } return t , nil }
NewTemporaryWithFiles creates a temporary go source tree after copying/creating files.
NewTemporaryWithFiles creates a temporary go source tree after copying / creating files .