coc-golang
Reference

Commands

Every go.* command, grouped by area.

Commands

All 85 commands are run with :CocCommand <id>.

Tests & benchmarks

CommandWhat it does
go.test.packageTest Go Package
go.test.explorerPick a Go Test
go.test.explorer.showShow Go Test Explorer
go.test.explorer.refreshRefresh Go Test Explorer
go.test.explorer.runRun Test Under Cursor in Go Test Explorer
go.test.explorer.openGo to Test Under Cursor in Go Test Explorer
go.test.explorer.runAllRun All Go Tests in Explorer
go.test.workspaceTest Go Workspace
go.test.fileTest Go File
go.test.cursorTest Go Function at Cursor
go.test.cursorOrPreviousTest Go Function at Cursor or Repeat Previous
go.subtest.cursorTest Go Subtest at Cursor
go.benchmark.packageBenchmark Go Package
go.benchmark.cursorBenchmark Go Function at Cursor
go.benchmark.fileBenchmark Go File
go.test.coverageTest Go Package with Coverage
go.apply.coverprofileApply Existing Coverage Profile
go.show.coverprofileOpen Coverage Profile
go.toggle.test.fileToggle Go Test File
go.test.previousRepeat Previous Go Test
go.test.generate.fileGenerate Tests for Go File
go.test.generate.packageGenerate Tests for Go Package
go.test.generate.functionGenerate Test for Go Function
go.test.cancelCancel Go Tests
go.test.showOutputShow Go Test Output

Build, vet, lint, run

CommandWhat it does
go.build.packageBuild Go Package
go.vet.packageVet Go Package
go.runRun Go Package
go.build.workspaceBuild Go Workspace
go.vet.workspaceVet Go Workspace
go.lint.packageLint Go Package
go.lint.workspaceLint Go Workspace
go.vulncheck.toggleToggle Vulncheck
go.generate.packageGenerate Go Package

Formatting & imports

CommandWhat it does
go.fmt.packageFormat Go Package
go.import.organizeOrganize Go Imports
go.import.addAdd Go Import

Modules

CommandWhat it does
go.mod.tidyTidy Go Modules
go.mod.vendorVendor Go Modules
go.mod.downloadDownload Go Modules
go.mod.initInitialize Go Module
go.mod.verifyVerify Go Modules
go.mod.whyExplain Go Dependency
go.mod.graphShow Go Module Graph
go.mod.edit.requireAdd Go Module Requirement
go.mod.edit.replaceReplace Go Module
go.mod.edit.droprequireDrop Go Module Requirement

Workspaces

CommandWhat it does
go.work.syncSync Go Workspace
go.work.initInitialize Go Workspace
go.work.useAdd Module to Go Workspace

Dependencies & packages

CommandWhat it does
go.get.packageGet Go Package
go.get.upgradeUpgrade Go Dependencies
go.install.packageInstall Go Package
go.pkg.searchSearch Go Packages Online
go.browse.packagesBrowse Go Packages

Struct tags & code generation

CommandWhat it does
go.tags.addAdd Go Struct Tags
go.tags.removeRemove Go Struct Tags
go.tags.clearClear Go Struct Tags
go.impl.cursorImplement Go Interface

Environment & tools

CommandWhat it does
go.envShow Go Environment
go.gopathShow GOPATH
go.gorootShow GOROOT
go.environment.chooseChoose Go Environment
go.versionShow Go Version
go.showChangeLogShow Changelog
go.tools.installInstall Go Tools
go.locate.toolsLocate Go Tools
go.languageserver.restartRestart gopls
go.gopls.installInstall or Update gopls
go.tools.install.dlvInstall Delve
go.tools.install.goimportsInstall goimports
go.tools.install.staticcheckInstall Staticcheck
go.tools.install.gomodifytagsInstall gomodifytags
go.tools.install.gotestsInstall gotests
go.tools.install.implInstall impl
go.tools.install.goplsInstall gopls
go.tools.install.golintInstall golint
go.tools.install.golangci-lintInstall golangci-lint
go.tools.install.golangci-lint-v2Install golangci-lint v2
go.tools.install.reviveInstall revive
go.tools.install.gofumptInstall gofumpt
go.tools.install.goformatInstall goformat
go.convert.jsonSchemaGenerate Go Types from JSON Schema
go.convert.jsonToGoGenerate Go Types from JSON
go.tools.install.go-jsonschemaInstall go-jsonschema

On this page