golang-safety

Review Go code for nil checks, type assertions, and concurrent map access.

Updated Apr 20, 2026
One-click install
npx skills add https://github.com/matdev83/go-llm-interactive-proxy --skill golang-safety-matdev83
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: golang-safety
Source: https://github.com/matdev83/go-llm-interactive-proxy/tree/main/.agents/skills/golang-safety
Command: npx skills add https://github.com/matdev83/go-llm-interactive-proxy --skill golang-safety-matdev83

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

This Skill helps Go developers prevent common panics and bugs caused by nil pointers, improper type assertions, and data races, promoting more robust code.

Core Features & Use Cases

  • Nil Safety: Detects potential nil interface and pointer issues, ensuring code handles nil values correctly.
  • Data Race Prevention: Advises on safe concurrent access to maps and slices, reducing synchronization bugs.
  • Safe Type Assertions: Guides using comma-ok and type switches to avoid runtime panics.
  • Example: Use this Skill to review Go code for proper nil checks and safe use of append and type assertions, improving code reliability in production systems.

Quick Start

Ask the AI to review a Go source file for common safety issues and anti-patterns, such as nil map writes, unchecked type assertions, or deferred resource leaks.

Frequently Asked Questions about golang-safety

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I prevent nil pointer panics in Go?

To prevent nil pointer panics in Go, enforce defensive practices like checking interfaces and pointers before use. This Skill identifies potential nil issues to ensure robust code execution.

What is the best way to handle type assertions in Go safely?

The best way to handle type assertions safely in Go is using the comma-ok pattern or type switches. This approach prevents runtime panics by checking assertion success before proceeding with the asserted type.

How do I avoid data races during concurrent map access in Go?

To avoid data races during concurrent map access in Go, apply proper synchronization patterns. This Skill advises on safe concurrent access to maps and slices, reducing synchronization bugs in concurrent operations.

How do I check a Go source file for resource leaks and safety anti-patterns?

To check a Go source file for resource leaks and safety anti-patterns, review the code for deferred resource management and nil map writes. This Skill enforces best practices to prevent runtime panics and security issues.

Does fixing Go safety issues require external tools or dependencies?

Fixing Go safety issues does not require external tools or dependencies. This Skill provides safety patterns from coding to concurrent operations using standard defensive practices without needing additional software.