Month: July 2018
-
Traversing Directories Recursively and Sorting Objects by Attribute Value in Go
Lets say you would like to sort all the files in a directory, as well as its sub directories by an attribute like file size. Approach: First, you need to recursively traverse or walk the specified directory, which is easy in Golang with the filepath.Walk() function from the path/filepath package. In order to use filepath.Walk()…