spf13 / afero

A FileSystem Abstraction System for Go
Apache License 2.0
5.79k stars 498 forks source link

cannot mockgen ReadFile and WriteFile method. #300

Open guillaumemugerin opened 3 years ago

guillaumemugerin commented 3 years ago

I have generate a mock with mockgen for testing afero's function but it seems that WriteFile and ReadFile function are not be intergrate in an interface. Is there any solution to do it ? Thanks in advance

jxsl13 commented 2 years ago

create a new interface that has those two methods and the afero methods and then generate a mock for that new interface.