Skip to content

Commit

Permalink
fix: install go lsp error (getcursor#362)
Browse files Browse the repository at this point in the history
  • Loading branch information
yugasun authored Mar 29, 2023
1 parent cbcdebe commit c0b9199
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/main/lsp.ts
Original file line number Diff line number Diff line change
Expand Up @@ -360,8 +360,12 @@ class LSPManager {
try {
// Check $GOPATH, and remove $GOPATH/go.mod file
const goPath = cp.execSync('echo $GOPATH').toString().trim()
fs.accessSync(`${goPath}go.mod`, fs.constants.F_OK)
await fileSystem.unlinkSync(`${goPath}/go.mod`)
try {
fs.accessSync(`${goPath}/go.mod`, fs.constants.F_OK)
await fileSystem.unlinkSync(`${goPath}/go.mod`)
} catch (e) {
// ignore remove remove $GOPATH/go.mod file error, it may not exist
}
await promisify(cp.exec)(
'go install golang.org/x/tools/gopls@latest',
{
Expand Down

0 comments on commit c0b9199

Please sign in to comment.