go-get-filenames Loop through all the files in a directory, get the filenames and write to a txt file Run the project Make sure you have Go installed on your machine. Replace the folder name filenames := readFilenames("pre-wedding") Execute $ go run main.go