← 返回 Skills 市场
bowen31337

Gopls LSP

作者 bowen31337 · GitHub ↗ · v1.0.0
cross-platform ✓ 安全检测通过
1213
总下载
0
收藏
2
当前安装
1
版本数
在 OpenClaw 中安装
/install gopls-lsp
功能描述
Go language server (gopls) providing code intelligence, refactoring, and analysis for .go files. Use when working with Go code that needs autocomplete, go-to-definition, find references, error detection, or refactoring support.
使用说明 (SKILL.md)

gopls LSP

Go language server integration providing comprehensive code intelligence through gopls (the official Go language server).

Capabilities

  • Code intelligence: Autocomplete, go-to-definition, find references
  • Error detection: Real-time diagnostics for compilation errors and issues
  • Refactoring: Rename symbols, extract function, organize imports
  • Analysis: Static analysis, code suggestions, unused code detection
  • Supported extensions: .go

Installation

Install gopls using the Go toolchain:

go install golang.org/x/tools/gopls@latest

Important: Make sure $GOPATH/bin (or $HOME/go/bin) is in your PATH.

Verify installation:

gopls version

Usage

The language server runs automatically in LSP-compatible editors. For manual operations:

Format code

gofmt -w file.go

Run linter

go vet ./...

Build and test

go build ./...
go test ./...

Configuration

Create gopls.yaml in your project or workspace for custom settings:

analyses:
  unusedparams: true
  shadow: true
completeUnimported: true
staticcheck: true

Or configure via environment:

export GOPLS_CONFIG='{"staticcheck": true, "analyses": {"unusedparams": true}}'

Integration Pattern

When editing Go code:

  1. gopls provides real-time diagnostics in LSP editors
  2. Run go fmt or gofmt to format code
  3. Use go vet for additional static analysis
  4. Run tests with go test before committing

Common Go Commands

  • go mod init \x3Cmodule> - Initialize Go module
  • go mod tidy - Clean up dependencies
  • go get \x3Cpackage> - Add dependency
  • go build - Compile packages
  • go run main.go - Run program
  • go test - Run tests
  • go vet - Report suspicious constructs

More Information

安全使用建议
This skill is coherent for adding gopls support: install via the official Go module (consider pinning to a specific version rather than @latest for reproducibility), ensure your Go bin directory is on PATH, and be aware the docs suggest exporting GOPLS_CONFIG (this is just configuration, not a secret). If you manage sensitive code, review gopls and Go modules you install before running network fetches (go get/go install) and consider auditing module versions.
功能分析
Type: OpenClaw Skill Name: gopls-lsp Version: 1.0.0 The skill bundle provides instructions for installing and using `gopls`, the official Go language server, along with common Go development commands. All commands and instructions are standard for Go development, such as `go install golang.org/x/tools/gopls@latest`, `gofmt`, `go vet`, `go build`, and `go test`. There is no evidence of data exfiltration, malicious execution, persistence mechanisms, or prompt injection attempts against the agent to perform actions outside the stated purpose of Go language support.
能力评估
Purpose & Capability
Name/description (gopls LSP) match the instructions: installing gopls via the Go toolchain and using Go tooling for formatting, vetting, building, and testing. No unrelated services, binaries, or credentials are requested.
Instruction Scope
SKILL.md stays within expected scope (install gopls, run go commands, configure gopls via a gopls.yaml or GOPLS_CONFIG). It references creating a gopls.yaml and exporting GOPLS_CONFIG, which is normal for configuration but the skill does not declare any required env vars — this is a minor inconsistency to be aware of.
Install Mechanism
No install spec in the registry; the doc recommends using `go install golang.org/x/tools/gopls@latest`, which is the standard, traceable distribution channel for gopls. No downloads from untrusted URLs or archive extraction are suggested.
Credentials
The skill declares no required environment variables, which is reasonable. The docs mention adding `$GOPATH/bin` (or $HOME/go/bin) to PATH and optionally exporting GOPLS_CONFIG; those are plausible and proportionate, but GOPLS_CONFIG is referenced without being listed in requires.env — harmless but inconsistent.
Persistence & Privilege
always is false and the skill has no code or install hooks that would persist or modify other skills or system-wide agent settings. Installation actions described are user-initiated (go install) and affect the user's Go bin directory only.
如何使用
  1. 确保已安装 OpenClaw(本地或 Docker 部署)
  2. 在对话框中输入安装命令:/install gopls-lsp
  3. 安装完成后,直接呼叫该 Skill 的名称或使用 /gopls-lsp 触发
  4. 根据 Skill 的参数说明提供必要输入,即可获得结构化输出
版本历史
v1.0.0
Initial release: Go language server (gopls) for code intelligence, refactoring, analysis.
元数据
Slug gopls-lsp
版本 1.0.0
许可证
累计安装 2
当前安装数 2
历史版本数 1
常见问题

Gopls LSP 是什么?

Go language server (gopls) providing code intelligence, refactoring, and analysis for .go files. Use when working with Go code that needs autocomplete, go-to-definition, find references, error detection, or refactoring support. 它是一个面向 Claude Code / OpenClaw 的 AI Agent Skill 插件,目前累计下载 1213 次。

如何安装 Gopls LSP?

在 OpenClaw 或 Claude Code 对话框中运行命令「/install gopls-lsp」即可一键安装,无需额外配置。

Gopls LSP 是免费的吗?

是的,Gopls LSP 完全免费(开源免费),可自由下载、安装和使用。

Gopls LSP 支持哪些平台?

Gopls LSP 跨平台运行,可在任意部署了 OpenClaw / Claude Code 的环境中使用(cross-platform)。

谁开发了 Gopls LSP?

由 bowen31337(@bowen31337)开发并维护,当前版本 v1.0.0。

💬 留言讨论