mirror of
https://github.com/golang/go
synced 2024-11-18 13:34:41 -07:00
internal/lsp: build output to package during gc_details code lens
The gc annotation details code lens did build binaries during diagnostics to the module root. When trying to enable details for a main package in a sub directory, it failed since the output binary name conflicted with the sub directory name. Instead, specify output to the package directory during build to avoid conflicts. Change-Id: Idc11e0c6a9ba15a66645aeef89bffb5abde76928 Reviewed-on: https://go-review.googlesource.com/c/tools/+/246419 Run-TryBot: Pontus Leitzler <leitzler@gmail.com> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Peter Weinberger <pjw@google.com>
This commit is contained in:
parent
6f4f008689
commit
3e8281990c
@ -23,7 +23,10 @@ func GCOptimizationDetails(ctx context.Context, snapshot Snapshot, pkgDir span.U
|
||||
if err := os.MkdirAll(outDir, 0700); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
args := []string{fmt.Sprintf("-gcflags=-json=0,%s", outDir), pkgDir.Filename()}
|
||||
args := []string{fmt.Sprintf("-gcflags=-json=0,%s", outDir),
|
||||
fmt.Sprintf("-o=%s", pkgDir.Filename()),
|
||||
pkgDir.Filename(),
|
||||
}
|
||||
err := snapshot.RunGoCommandDirect(ctx, "build", args)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
|
Loading…
Reference in New Issue
Block a user