Dave Cheney 12/8/2019

Dynamically scoped variables in Go

Read Original

The article is a technical deep dive into Go API design, specifically addressing repetitive error checking in unit tests. It critiques the classic pattern of passing *testing.T to helpers and proposes an experiment using dynamically scoped variables (via context or runtime frames) to access the test's `t` without explicit parameter passing, aiming for cleaner and less error-prone test code.

Dynamically scoped variables in Go

Comments

No comments yet

Be the first to share your thoughts!

Browser Extension

Get instant access to AllDevBlogs from your browser