Skip to main content
Back to Extensions Directory
coc-golang icon

coc-golang

xiyaowong

Go language support for coc.nvim using gopls

Installation CommandVim prompt
:CocInstall coc-golang
GitHub owner
xiyaowong
Version
v0.2.0
npm package
coc-golang
Requirements
coc >=0.0.82
License
MIT
Repository
GitHub
npm latest published 2026-10-08Registry checked 2026-10-08Node >=22.18.0Registry summary

Published Package Summary

coc-golang logo

Logo concept by @xiyaowong, drawn with AI

coc-golang

Go language support for coc.nvim, powered by the official gopls language server and Go tools.

Install · Features · Commands · Configuration · Development

Overview

coc-golang brings Go development features to Vim and Neovim through coc.nvim. It uses gopls for language intelligence and provides commands for testing, building, formatting, linting, vulnerability checks, and common Go project tasks.

Installation

Requirements

  • Vim or Neovim with coc.nvim 0.0.82 or newer
  • Node.js 22.18 or newer
  • Go

Install the extension from Vim or Neovim:

:CocInstall coc-golang

Open a Go file to activate the extension. If gopls is not installed, coc-golang prompts you to install it. You can also install it at any time with:

:CocCommand go.gopls.install

Features

  • Language intelligence: completion, hover, signature help, diagnostics, navigation, references, rename, code actions, and document symbols through gopls.
  • Formatting and imports: format Go code and add or organize imports.
  • Build and checks: build, run, vet, lint, and scan packages or workspaces for known vulnerabilities.
  • Tests and benchmarks: run tests at package, workspace, file, or cursor scope; repeat the previous run; collect coverage; and run benchmarks.
  • Project workflows: manage modules and workspaces, install Go tools, generate code or tests, edit struct tags, and generate interface implementations.
  • Go environment: inspect Go settings and configure environments for gopls, Go commands, and installed tools.

gopls handles language features. go run, go test, benchmarks, go doc, go get, go install and go mod init run in a coc.nvim terminal named Go; other command output is shown in the Go output channel.

Development

Install dependencies, then build and type-check:

npm install
npm run build
npm run typecheck

The build writes the extension bundles to lib/.

AI-assisted

Most of the code is AI-generated. Direction was manual.

Scope

The persistent VS Code test explorer, Delve debug adapter UI, survey and telemetry, coverage overlays, and rich diagnostic visualization are not included. Update checks cover gopls only.

Read the complete README
  • Go language support for coc.nvim using gopls
Activation Events
  • onLanguage:go
  • onLanguage:gomod
  • onLanguage:gowork
  • onCommand:go.test.package
  • onCommand:go.test.explorer
  • onCommand:go.test.workspace
  • onCommand:go.test.file
  • onCommand:go.test.cursor
  • onCommand:go.test.cursorOrPrevious
  • onCommand:go.subtest.cursor
  • onCommand:go.benchmark.package
  • onCommand:go.benchmark.cursor
  • onCommand:go.benchmark.file
  • onCommand:go.test.coverage
  • onCommand:go.toggle.test.file
  • onCommand:go.test.previous
  • onCommand:go.build.package
  • onCommand:go.vet.package
  • onCommand:go.run
  • onCommand:go.gopath
  • onCommand:go.goroot
  • onCommand:go.environment.choose
  • onCommand:go.tools.install
  • onCommand:go.languageserver.restart
  • onCommand:go.build.workspace
  • onCommand:go.vet.workspace
  • onCommand:go.lint.package
  • onCommand:go.lint.workspace
  • onCommand:go.vulncheck.toggle
  • onCommand:go.fmt.package
  • onCommand:go.import.organize
  • onCommand:go.import.add
  • onCommand:go.generate.package
  • onCommand:go.mod.tidy
  • onCommand:go.mod.vendor
  • onCommand:go.work.sync
  • onCommand:go.mod.init
  • onCommand:go.get.package
  • onCommand:go.install.package
  • onCommand:go.test.generate.file
  • onCommand:go.test.generate.package
  • onCommand:go.test.generate.function
  • onCommand:go.tags.add
  • onCommand:go.tags.remove
  • onCommand:go.tags.clear
  • onCommand:go.impl.cursor
  • onCommand:go.test.cancel
  • onCommand:go.test.showOutput
  • onCommand:go.browse.packages
  • onCommand:go.gopls.install
  • onCommand:go.tools.install.dlv
  • onCommand:go.tools.install.goimports
  • onCommand:go.tools.install.staticcheck
  • onCommand:go.tools.install.gomodifytags
  • onCommand:go.tools.install.gotests
  • onCommand:go.tools.install.impl
  • onCommand:go.tools.install.gopls
  • onCommand:go.version
  • onCommand:go.env
  • onCommand:go.locate.tools
  • onCommand:go.tools.install.golint
  • onCommand:go.tools.install.golangci-lint
  • onCommand:go.tools.install.golangci-lint-v2
  • onCommand:go.tools.install.revive
  • onCommand:go.tools.install.gofumpt
  • onCommand:go.tools.install.goformat
Developer Resources

Want to build, test, or contribute to coc.nvim extensions? Explore our official SDK and testing toolkits.

Open Developer Guide

Version History

Published with coc-golang@0.2.0 as CHANGELOG.md.

Open source file

Changelog

0.2.0 (2026-10-08)

Features

  • improve Go commands and extension testing (7f441ca)