Comment

Comment by peacelilly

The secret to wrapping errors is the erros.As and errors.Is special interfaces called out only in the documentation: https://pkg.go.dev/errors#Is

You must build a Directed Acyclic Graph (DAG) to ensure these special interfaces don't hit an infinite loop.

To stop the infinite loop cycles, and actually implement a DAG, I marked visited nodes and returned `false` if the nodes were already marked.

parent peacelilly 3 years ago

Discussion

Live from the official Hacker News API

A modern reader for Hacker News · SvelteKit + Skeleton