Golang: unit testing os.File.Write call : I want to unit test a function that calls `os.File.Write()` and want 100% coverage. 

This function returns `n` and an error. Inducing an error is easy. All I need is to close the file. How can I induce no write error and a value `n` different of the written data length ?

It looks like I should create a dummy os.File on which I can control the error returned. Unfortunately, os.File is not an interface. 

