Goland

From G1Joshi/Agent-Skills · View interactive version

Goland is an AI agent skill from the GitHub repository G1Joshi/Agent-Skills. Expert JetBrains GoLand IDE assistance covering Go tools, live profiling, delve debugger, refactoring, and test runners. Use when developing, profiling, and debugging Go applications.

How to use this skill

Skill file

GoLand

GoLand provides deep understanding of Go code. It excels at Interface implementation navigation and Goroutine debugging.

When to Use

Quick Start

// Set breakpoint in GoLand and press Shift+F9 to debug with Delve:
package main

import "fmt"

func main() {
    message := "Debugging with GoLand"
    fmt.Println(message) // Set breakpoint here to inspect variables
}

Core Concepts

Delve Debugger & Goroutine Inspection

Configuring launch settings and inspecting runtime state:

// .vscode/launch.json or GoLand Run Configuration
{
  "version": "0.2.0",
  "configurations": [
    {
      "name": "Debug API Microservice",
      "type": "go",
      "request": "launch",
      "mode": "auto",
      "program": "${workspaceFolder}/cmd/server/main.go",
      "env": {
        "PORT": "8080",
        "ENV": "local_dev"
      },
      "args": ["--verbose"]
    }
  ]
}

During a breakpoint pause:

Built-in Profiling with pprof & Flame Graphs

Running benchmarks with integrated memory and CPU profiling:

// Benchmarking function in user_test.go
func BenchmarkUserSerialization(b *testing.B) {
    user := NewTestUser()
    b.ResetTimer()
    for i := 0; i < b.N; i++ {
        _ = user.SerializeToJSON()
    }
}

Build Tags & Cross-Compilation Run Configurations

Switching between build environments:

// +build integration

package tests

import "testing"

func TestRemoteDatabaseIntegration(t *testing.T) {
    // Only compiled when build tag 'integration' is passed
}

Common Patterns

Headless Remote Delve Debugging

Problem: Debug Go services running inside Kubernetes or Docker containers.

Solution: Connect GoLand to remote Delve debugger.

# Start Delve server in container
dlv exec ./my-binary --headless --listen=:2345 --api-version=2 --accept-multiclient
<!-- .run/Remote Debug.run.xml -->
<component name="ProjectRunConfigurationManager">
  <configuration default="false" name="Remote Debug" type="GoRemoteDebugConfigurationType">
    <port>2345</port>
    <host>localhost</host>
  </configuration>
</component>

Best Practices

Do:

Don't:

Troubleshooting

| Error | Cause | Solution |

| :------------------------------------------------------- | :---------------------------------------------------------------------- | :--------------------------------------------------------------------- |

| Unresolved reference in GoLand but 'go build' succeeds | IDE Go SDK or module cache out of sync with filesystem. | Go to File > Invalidate Caches / Restart and verify GOPATH/GOROOT. |

| Debugger failed: could not launch process with Delve | Delve binary permission issue or macOS security signing. | Grant Developer Tools permission in macOS System Settings > Security. |

| Go modules disabled in project | GoLand project settings have "Enable Go modules integration" unchecked. | Check Settings > Go > Go Modules > Enable Go modules integration. |

References

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.