A Go script that scans directory structure and saves it to output.txt
- Scans any directory (current directory by default)
- Option to show only directories or both directories and files
- Creates hierarchical tree structure with indentation
- Uses emoji icons for visual distinction (📁 for folders, 📄 for files)
- Saves results to output.txt in specified location
- Run the script:
go run main.go - Enter directory to scan (press Enter for current directory)
- Choose whether to show only directories (y/n)
- Specify output path for output.txt (press Enter for current directory)
📁 folder1
📁 subfolder
📄 file1.txt
📄 file2.txt
📄 document.pdf
📁 folder2
📄 README.md