go-error-cleanup

Replace Go error returns and checks with mylog.Check, Check2, and Call utilities.

85|13|Updated Jul 14, 2022
One-click install
npx skills add https://github.com/HyperDbg/gui --skill go-error-cleanup
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: go-error-cleanup
Source: https://github.com/HyperDbg/gui/tree/main/.trae/skills/go-error-cleanup
Command: npx skills add https://github.com/HyperDbg/gui --skill go-error-cleanup

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This skill eliminates scattered and repetitive Go error handling by replacing error returns and checks with mylog utilities, streamlining code and reducing boilerplate.

Core Features & Use Cases

  • Removes error return types from function signatures and interface methods.
  • Replaces error checks with mylog.Check() or mylog.Check2() to standardize error handling.
  • Replaces defer recover() blocks with mylog.Call() and removes panic/recover usage to improve resilience.

Quick Start

Run the tool on your Go codebase to automatically replace error handling with mylog.Check/Check2/Call.

Frequently Asked Questions about go-error-cleanup

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

FAQPage Schema
How do I remove error returns and boilerplate from Go code?

To remove error returns and reduce boilerplate in Go code, you can replace error checks and return types with mylog utilities like mylog.Check and mylog.Check2 to normalize error handling across your project.

How do I replace defer recover blocks with centralized error handling in Go?

You can replace defer recover blocks in Go by using mylog.Call and eliminating panic/recover usage entirely. This normalizes error handling and improves application resilience without relying on scattered recovery logic.

Can I refactor function signatures to drop error results across an entire Go project?

Yes, you can refactor function signatures to drop error results across an entire Go project. This process applies to functions, interfaces, and packages of all sizes to systematically normalize and streamline error handling.

What is the best way to standardize Go error handling without repetitive if err != nil checks?

The best way to standardize Go error handling without repetitive checks is to replace them with mylog.Check or mylog.Check2 utilities. This eliminates scattered code and standardizes the error processing mechanism throughout your codebase.

Does automated Go error cleanup affect existing interface methods?

Automated Go error cleanup directly affects existing interface methods by rewriting their signatures to drop error results. It systematically updates interfaces and functions to align with the mylog utility pattern.

When should I avoid removing error returns from Go function signatures?

You should avoid removing error returns from Go function signatures when external callers depend on handling those specific error values, as converting to mylog utilities delegates error processing away from the immediate caller.