Skip to content
hakk
  • Home
  • Blog
  • Docs
  • DSA
  • Snippets

Directory

  • How to list files in a directory using Go [2023] 2022-10-25

    In Go there are a couple of options to list the files of a directory using the standard library. In this article you will find a list of three different methods.

    Note: Be aware that ioutil.ReadDir is deprecated since Go 1.16. Instead os.ReadDir should be used (shown in this article).

    os.ReadDir

    os.ReadDir is included in the standard library in the os package. Check out the documentation for more information. It’s a drop in replacement from ioutil.ReadDir.

Recent posts
  • How to Update a File's Creation Time in PowerShell
  • How to Run PowerShell Code Only During Certain Times
  • PeopleSoft App Server Freeze Troubleshooting Checklist
  • Build Vim With Python3 Support
  • Understanding the ss Command: A Modern Alternative to netstat
© 2026 hakk
  • Home
  • Blog
  • Docs
  • DSA
  • Snippets