One of the more useful, but underutilized, packages in Go is the path/filepath package. This library contains a dozen or so tools for manipulating paths on the filesystem. Unlike path, filepath functions are aware of the filesystem, and the functions are not merely string manipulators.
I've recently seen several cases where people misunderstood one of the functions in path/filepath. The misconception is that filepath.Clean() is a security function that will sanitize a path. It's not.
...
Published on March 30, 2016 20:39