Just an idea, I think https://github.com/askiada/external-sort/blob/8a71574cb0791a63b202f639cf78e754bd4aa106/file/file.go#L42 is potentially dangerous. What if the responsibility was completely offloaded to the user of the library?