Skip to content

Commit de3ffe0

Browse files
aykevldeadprogram
authored andcommitted
main: add cached GOROOT to info subcommand
This is necessary for an upcoming VS Code extension to support TinyGo, and may be useful for other people wanting to use proper autocompletion etc in their IDE.
1 parent 1e47d9e commit de3ffe0

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

main.go

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -940,12 +940,18 @@ func main() {
940940
fmt.Fprintln(os.Stderr, err)
941941
os.Exit(1)
942942
}
943+
cachedGOROOT, err := loader.GetCachedGoroot(config)
944+
if err != nil {
945+
fmt.Fprintln(os.Stderr, err)
946+
os.Exit(1)
947+
}
943948
fmt.Printf("LLVM triple: %s\n", config.Triple())
944949
fmt.Printf("GOOS: %s\n", config.GOOS())
945950
fmt.Printf("GOARCH: %s\n", config.GOARCH())
946951
fmt.Printf("build tags: %s\n", strings.Join(config.BuildTags(), " "))
947952
fmt.Printf("garbage collector: %s\n", config.GC())
948953
fmt.Printf("scheduler: %s\n", config.Scheduler())
954+
fmt.Printf("cached GOROOT: %s\n", cachedGOROOT)
949955
case "list":
950956
config, err := builder.NewConfig(options)
951957
if err != nil {

0 commit comments

Comments
 (0)