File tree Expand file tree Collapse file tree 2 files changed +7
-13
lines changed
Expand file tree Collapse file tree 2 files changed +7
-13
lines changed Original file line number Diff line number Diff line change @@ -27,8 +27,8 @@ The flags are:
2727 report all errors (not just the first 10)
2828 -v
2929 verbose mode
30- -gccgo
31- use gccimporter instead of gcimporter
30+ -c
31+ compiler used to compile packages (gc or gccgo); default: gc
3232
3333Debugging flags:
3434 -seq
Original file line number Diff line number Diff line change @@ -9,26 +9,24 @@ import (
99 "fmt"
1010 "go/ast"
1111 "go/build"
12+ "go/importer"
1213 "go/parser"
1314 "go/scanner"
1415 "go/token"
16+ "go/types"
1517 "io/ioutil"
1618 "os"
1719 "path/filepath"
1820 "runtime"
1921 "time"
20-
21- "golang.org/x/tools/go/gccgoimporter"
22- _ "golang.org/x/tools/go/gcimporter"
23- "golang.org/x/tools/go/types"
2422)
2523
2624var (
2725 // main operation modes
2826 allFiles = flag .Bool ("a" , false , "use all (incl. _test.go) files when processing a directory" )
2927 allErrors = flag .Bool ("e" , false , "report all errors (not just the first 10)" )
3028 verbose = flag .Bool ("v" , false , "verbose mode" )
31- gccgo = flag .Bool ( "gccgo " , false , "use gccgoimporter instead of gcimporter " )
29+ compiler = flag .String ( "c " , "gc" , "compiler used to compile packages (gc or gccgo) " )
3230
3331 // debugging support
3432 sequential = flag .Bool ("seq" , false , "parse sequentially, rather than in parallel" )
@@ -195,12 +193,8 @@ func checkPkgFiles(files []*ast.File) {
195193 }
196194 report (err )
197195 },
198- Sizes : sizes ,
199- }
200- if * gccgo {
201- var inst gccgoimporter.GccgoInstallation
202- inst .InitFromDriver ("gccgo" )
203- conf .Import = inst .GetImporter (nil , nil )
196+ Importer : importer .For (* compiler , nil ),
197+ Sizes : sizes ,
204198 }
205199
206200 defer func () {
You can’t perform that action at this time.
0 commit comments