Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

memfs: ReadDir sorted by filename #13

Merged
merged 1 commit into from
Mar 10, 2021
Merged

Conversation

MetalBlueberry
Copy link

This request ensures the order returned by ReadDir for memfs.

The entries are sorted lexicographically because this is how to strings are automatically sorted, The interface does not specify how the filename is sorted, but I think it makes sense to use the default behavior.

type Dir interface {
	// ReadDir reads the directory named by dirname and returns a list of
	// directory entries sorted by filename.
	ReadDir(path string) ([]os.FileInfo, error)
}

Reference: https://golang.org/src/strings/compare.go

@mcuadros mcuadros changed the title Fix #12, MemFS ReadDir sorted by filename memfs: ReadDir sorted by filename Mar 10, 2021
@mcuadros mcuadros merged commit b791567 into go-git:master Mar 10, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants