compiler: remove not used functions

This commit is contained in:
Vsevolod Brekelov 2019-12-20 13:05:47 +03:00
parent 79323cc10b
commit d576aa2753

View file

@ -3,10 +3,7 @@ package compiler
import ( import (
"bytes" "bytes"
"fmt" "fmt"
"go/ast"
"go/build"
"go/parser" "go/parser"
"go/types"
"io" "io"
"io/ioutil" "io/ioutil"
"os" "os"
@ -61,11 +58,6 @@ func Compile(r io.Reader) ([]byte, error) {
return buf, nil return buf, nil
} }
type archive struct {
f *ast.File
typeInfo *types.Info
}
// CompileAndSave will compile and save the file to disk. // CompileAndSave will compile and save the file to disk.
func CompileAndSave(src string, o *Options) ([]byte, error) { func CompileAndSave(src string, o *Options) ([]byte, error) {
if !strings.HasSuffix(src, ".go") { if !strings.HasSuffix(src, ".go") {
@ -90,11 +82,3 @@ func CompileAndSave(src string, o *Options) ([]byte, error) {
out := fmt.Sprintf("%s.%s", o.Outfile, o.Ext) out := fmt.Sprintf("%s.%s", o.Outfile, o.Ext)
return b, ioutil.WriteFile(out, b, os.ModePerm) return b, ioutil.WriteFile(out, b, os.ModePerm)
} }
func gopath() string {
gopath := os.Getenv("GOPATH")
if len(gopath) == 0 {
gopath = build.Default.GOPATH
}
return gopath
}