Abhinav Gupta | About

Posts

2022

Subcommands with Go's flag package

Handle spaces in file names with xargs

Mock programs to test os/exec in Go

2021

Go errors: Use %q with fmt.Errorf

How to write flexible YAML shapes in Go

2020

How to parse Newline Delimited JSON in Go

Go Gotcha: Struct pointers as map keys

Fix-up Git commits with Tig

2019

Filter Go slices without allocating

Restack Git branches automatically

Go Antipatterns: Channels that fire once

Understanding Go's token.Pos

2018

Go Antipatterns: With* Context Managers