golang-safety

Detect Go programming errors and enforce defensive coding practices.

Updated Jun 27, 2026
One-click install
npx skills add https://github.com/LuigiAPCPereira/evolutiondocs --skill golang-safety-luigiapcpereira
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: golang-safety
Source: https://github.com/LuigiAPCPereira/evolutiondocs/tree/main/.agents/skills/golang-safety
Command: npx skills add https://github.com/LuigiAPCPereira/evolutiondocs --skill golang-safety-luigiapcpereira

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires golangci-lint, go, and includes scripts (resource) and references (resource) components.

What problem does it solve?

This Skill helps prevent common Go programming pitfalls, such as nil panics, silent data corruption, and subtle runtime bugs, by enforcing defensive coding and best practices.

Core Features & Use Cases

  • Nil Safety: Detects and prevents nil pointer dereferences.
  • Slice and Map Safety: Mitigates issues with slice aliasing, append behavior, and concurrent map access.
  • Numeric Safety: Ensures safe numeric comparisons and type conversions.
  • Resource Safety: Manages resources like goroutines and deferred operations correctly.
  • Immutability & Defensive Copying: Encourages the use of defensive copying for shared data.
  • Initialization Safety: Ensures types are initialized safely, and initializes structures correctly.
  • Use Case: When reviewing Go code or writing a new Go application, use this Skill to enforce best practices and improve code safety.

Quick Start

Run the 'golang-safety' skill on your codebase to automatically identify and fix common safety issues.

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 dereferences and silent data corruption in Go?

To prevent nil pointer dereferences and silent data corruption in Go, use static analysis to detect nil panics, mitigate slice aliasing, and enforce safe initialization. This Skill applies defensive coding to resolve these runtime issues.

What is the best way to fix concurrent map access and slice aliasing issues in Golang?

The best way to fix concurrent map access and slice aliasing issues in Golang is running static analysis to identify unsafe patterns. This Skill mitigates these issues by enforcing defensive copying for shared data and safe append behaviors.

Do I need golangci-lint installed to check Go code safety?

Yes, you need golangci-lint installed to check Go code safety. This Skill requires both golangci-lint and go for static analysis and code execution to identify numeric overflows and enforce best coding standards.

How does defensive coding handle numeric overflows and goroutine resource management?

Defensive coding handles numeric overflows and goroutine resource management by ensuring safe type conversions, correct numeric comparisons, and properly managing deferred operations. This Skill automatically identifies these resource safety issues during code review.

When should I use defensive copying for shared data structures in Go?

You should use defensive copying for shared data structures in Go whenever multiple variables reference the same underlying slice or map. This Skill encourages immutability practices to prevent silent data corruption during concurrent operations.