Prompt Refactor

Go Error Handling Patterns

Apply idiomatic Go error handling with wrapping, errors.Is, and errors.As.

go
Insert label Error Handling
Prompt

Refactor error handling in this Go code to use idiomatic patterns. Wrap errors with fmt.Errorf and %w for context, use errors.Is and errors.As for type checking, define sentinel errors where appropriate, and never discard errors silently.

Add this to your Facet Inserts in Crystl for one-click access.

Get Crystl