Re: [go-nuts] fstest.MapFS ReadDir does not set name field for entry.Name()

2022-04-02 Thread Ian Lance Taylor
On Sat, Apr 2, 2022 at 2:46 PM Kalen Krempely wrote: > > 2) As a follow up question I find it weird that VerifyDir needs to take in > both a filesystem and the root path. (ie: `VerifyDir(fsys fs.FS, dir > string)`) That is, the calling code will be something like > VerifyDir(os.DirFS("/some/pat

Re: [go-nuts] fstest.MapFS ReadDir does not set name field for entry.Name()

2022-04-02 Thread Kalen Krempely
Thanks Ian for the reply! *1)* I think I figured out what was going on. Basically, I need to pass the root path to my verifyDir function and just have the fstest.MapFS contain the sub elements, rather than the full paths. That is, the example test code needs to be: t.Run("some test", func(t *te

Re: [go-nuts] fstest.MapFS ReadDir does not set name field for entry.Name()

2022-03-23 Thread Ian Lance Taylor
On Wed, Mar 23, 2022 at 2:01 PM Kalen Krempely wrote: > > I am trying to use fstest.MapFS to help with testing, but I noticed the mapfs > implementation of ReadDir does not set the name field which is quite > problematic as I rely on that in my code. > > Example Test Code: > t.Run("some test", f

[go-nuts] fstest.MapFS ReadDir does not set name field for entry.Name()

2022-03-23 Thread Kalen Krempely
I am trying to use fstest.MapFS to help with testing, but I noticed the mapfs implementation of ReadDir does not set the name field which is quite problematic as I rely on that in my code.