Skip to main content

Adding context to errors in Go

· 4 min read
Yaroslav Grebnov
Golang developer, SDET

This post compares two ways to enrich Go errors — both sentinel and typed — with additional context:

  • github.com/ygrebnov/errorc.With
  • the standard fmt.Errorf approach

The main difference is not only syntax. errorc gives you a more structured way to attach fields, and it works especially well together with github.com/ygrebnov/keys when you want stable hierarchical field names such as user.id or request.trace_id.

How to use enums in Python applications

· 18 min read
Yaroslav Grebnov
Golang developer, SDET

Python enum package allows to utilise very powerful functionality in terms of managing constants and configuration entities. These entities are very compact and in many cases are more convenient to use than dictionaries or configuration files in any format. In a set of examples below, we will demonstrate how to use enums in Python applications as well as the benefits of such usage.