DEV Community

Discussion on: How a calculation of previous month in golang can break production

dougaws profile image

The first step should have been to define what "previous month of a given date" means, since the previous month might not have a 1-1 corresponding date.

Once that term is defined, then you create unit tests, such as previous date for March 30.