Reading and writing

Reading and writing files can be done in numerous ways. Go provides interfaces that make it easy to write your own functions that work with files or any other reader/writer interface.

Between the os, io, and ioutil packages, you can find the right function for your needs. These examples cover a number of the options available.

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.