From de3ffe0af75305e354bfb3dadbba543809f3d8d5 Mon Sep 17 00:00:00 2001 From: Ayke van Laethem Date: Mon, 7 Sep 2020 00:28:48 +0200 Subject: [PATCH] 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. --- main.go | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/main.go b/main.go index 218f5507..70cfb093 100644 --- a/main.go +++ b/main.go @@ -940,12 +940,18 @@ func main() { fmt.Fprintln(os.Stderr, err) os.Exit(1) } + cachedGOROOT, err := loader.GetCachedGoroot(config) + if err != nil { + fmt.Fprintln(os.Stderr, err) + os.Exit(1) + } fmt.Printf("LLVM triple: %s\n", config.Triple()) fmt.Printf("GOOS: %s\n", config.GOOS()) fmt.Printf("GOARCH: %s\n", config.GOARCH()) fmt.Printf("build tags: %s\n", strings.Join(config.BuildTags(), " ")) fmt.Printf("garbage collector: %s\n", config.GC()) fmt.Printf("scheduler: %s\n", config.Scheduler()) + fmt.Printf("cached GOROOT: %s\n", cachedGOROOT) case "list": config, err := builder.NewConfig(options) if err != nil {