تخطَّ إلى المحتوى
TakoAPI
العودة إلى المهارات

gopls-lsp

بواسطة bowen31337

Coding Agents & IDEs
880التنزيلات وفق ما يذكره clawskills.sh
0المشاهدات
لا إعجاباتسجّل الدخول للإعجاب بهذه المهارة
—لم يُقيَّم بعد
تقييمك

موجز

Go language server (gopls) providing code intelligence, refactoring, and analysis for .go files.

الوصف

ما الذي تفعله هذه المهارة

gopls is the official Go language server, providing code intelligence for .go files via the LSP protocol. It handles autocomplete, go-to-definition, find references, real-time error diagnostics, and refactoring like symbol renaming and import organization.

As the official Go language server maintained by the Go team, it stays current with new language features and provides more accurate analysis than third-party alternatives.

متى تستخدمها

  • Navigating to a function definition in a large Go codebase
  • Renaming a struct field across all files in a module
  • Catching type errors before running go build
  • Automatically organizing imports while editing a file
  • Finding all callers of an interface method

مثال على سير العمل

الإدخال

User asks: rename the UserID field in the User struct to ID across the entire project

الوكيل
  1. 1

    gopls locates all references to UserID across .go files in the module

  2. 2

    Checks for naming conflicts the rename would introduce

  3. 3

    Applies the rename atomically across all affected files

  4. 4

    Reports the count of files and occurrences updated

الإخراج

All references to UserID replaced with ID across the project, no conflicts introduced

المتطلبات

  • gopls installed via `go install golang.org/x/tools/gopls@latest` with $GOPATH/bin (or $HOME/go/bin) added to PATH

التثبيت

clawhub install bowen31337/gopls-lsp

شغّل أمر واجهة سطر الأوامر، أو الصق النص في Claude Code أو Cursor أو Codex أو أي وكيل برمجة تستخدمه.

الروابط