Realpath for Go. This finds the true path of a file or directory, resolving any symbolic links.
It adds some extra features to the yookoala library's filepath package. Instead of manually iterating over the path components, it uses the filepath.Abs
, filepath.Clean
function to do it for you. It also evaluates symbolic links.
go get github.com/gandarez/go-realpath
import "github.com/gandarez/go-realpath"
func main() {
rp, err := realpath.Realpath("/some/path")
}