Skip to content

Commit

Permalink
Fixed go lang install issue (#279)
Browse files Browse the repository at this point in the history
Removed the old go version
  • Loading branch information
alexwebdevs committed Mar 27, 2023
1 parent c6a532c commit 63bd917
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/main/lsp.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ import {
import log from 'electron-log'
import Store from 'electron-store'
import fixPath from 'fix-path'
import { fileSystem } from './fileSystem'

const writeFilePromise = promisify(fs.writeFile)
const lspDir = app.isPackaged
Expand Down Expand Up @@ -360,6 +361,10 @@ class LSPManager {
case 'go':
const goDir = path.join(lspDir, 'go')
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`)
await promisify(cp.exec)(
'go install golang.org/x/tools/gopls@latest',
{
Expand Down

0 comments on commit 63bd917

Please sign in to comment.