func TranslateFiles(files ...NamedFile) ([][]byte, []error) {
	return TranslateFilesFrom("", files...)
}
TranslateFiles translates SGo code from the given files. It returns
the contents of the generated Go files.

For SGo: func(files ...NamedFile) ([][]byte, []error)
package sgo
import (
	"bufio"
	"bytes"
	"fmt"
	"go/build"
	"io"
	"io/ioutil"
	"os"
	"path/filepath"
	"strings"
	"github.com/tcard/sgo/sgo/ast"
	"github.com/tcard/sgo/sgo/importer"
	"github.com/tcard/sgo/sgo/importpaths"
	"github.com/tcard/sgo/sgo/parser"
	"github.com/tcard/sgo/sgo/printer"
	"github.com/tcard/sgo/sgo/scanner"
	"github.com/tcard/sgo/sgo/token"
	"github.com/tcard/sgo/sgo/types"
)
func TranslatePaths(paths []string) (created []string, warnings []error, errs []error) {
	cwd, err := os.Getwd()
	if err != nil {
		errs = append(errs, err)
		return
	}
	paths, warnings = importpaths.ImportPaths(paths)
	for _, path := range paths {
		pkg, err := build.Default.Import(path, cwd, build.FindOnly|build.IgnoreVendor)
		if err != nil {
			errs = append(errs, err)
			continue
		}
		transCreated, transErrs := TranslateDir(pkg.Dir)
		created = append(created, transCreated...)
		errs = append(errs, transErrs...)
	}
	return created, warnings, errs
}
func TranslateDir(dirName string) ([]string, []error) {
	var errs []error
	var paths []string
	dir, err := os.Open(dirName)
	if err != nil {
		return nil, []error{err}
	}
	fileNames, err := dir.Readdirnames(-1)
	dir.Close()
	if err != nil {
		return nil, []error{err}
	}
	for _, fileName := range fileNames {
		ext := filepath.Ext(fileName)
		if ext != ".sgo" {
			continue
		}
		paths = append(paths, filepath.Join(dirName, fileName))
	}
	if err != nil {
		errs = append(errs, err)
		return nil, errs
	}
	return TranslateFilePathsFrom(dirName, paths...)
}
func TranslateFilePaths(paths ...string) ([]string, []error) {
	return TranslateFilePathsFrom("", paths...)
}
func TranslateFilePathsFrom(whence string, paths ...string) ([]string, []error) {
	var named []NamedFile
	for _, path := range paths {
		f, err := os.Open(path)
		if err != nil {
			return nil, []error{err}
		}
		defer f.Close()
		named = append(named, NamedFile{path, f})
	}
	translated, errs := TranslateFilesFrom(whence, named...)
	if len(errs) > 0 {
		return nil, errs
	}
	var created []string
	for i, t := range translated {
		path := named[i].Path
		ext := filepath.Ext(path)
		createdPath := path[:len(path)-len(ext)] + ".go"
		dst, err := os.Create(createdPath)
		if err != nil {
			errs = append(errs, err)
			continue
		}
		created = append(created, createdPath)
		_, err = dst.Write(t)
		if err != nil {
			errs = append(errs, err)
			continue
		}
	}
	return created, errs
}
type NamedFile struct {
	Path string
	File io.Reader
}