ended3월 19일· 3 sources

The Secret Life of Go: Error Handling

Go의 숨겨진 세계: 에러 처리

Why it matters

The article illustrates Go error handling best practices through a dialogue between two engineers. It explains why string-based error checking (strings.Contains) is brittle and introduces Sentinel Errors as exported variables that represent specific failure states, checked via errors.Is. It also covers error wrapping with fmt.Errorf, contrasting %v (which breaks the error chain) with %w (which preserves it for errors.Is inspection).

3
Sources
+0
24h
Growth
186d
Active
custom structerror handlingerror wrappingerrors.aserrors.isfmt.errorfgosentinel errors

Sources

Related Issues