How to perform file system scanning in Golang?

  1. I need to write a function which when given the path of a folder scans the files rooted at that folder.
  2. And then I need to display the directory structure at that folder.

I know how to do 2 (I am going to use jstree to display it in the browser).

Please help me with part 1, like what/where to start to write such a function in go.