File basics

Because files are such an integral part of the computing ecosystem, it is crucial to understand the options available in Go for working with files. This section covers some basic operations, such as opening, closing, creating, and deleting files. Additionally, it covers renaming and moving, seeing if files exist, modifying permissions, ownership, timestamps, and working with symbolic links. Most of these examples use a hard-coded filename of test.txt. Change this filename if you want to operate on a different file.

Get Security with Go now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.