Refactoring Go Code to Avoid File I/O in Unit Tests

from blog Matthias Endler, | ↗ original
At work today, I refactored some simple Go code to make it more testable. The idea was to avoid file handling in unit tests without mocking or using temporary files by separating data input/output and data manipulation.