August 2019
Beginner to intermediate
798 pages
17h 2m
English
In this section, you will learn how to read exactly the amount of data you want. This technique is particularly useful when reading binary files, where you have to decode the data you read in a particular way. Nevertheless, this technique still works with text files.
The logic behind this technique is as follows: you create a byte slice with the size you need and use that byte slice for reading. To make this more interesting, this functionality is going to be implemented as a function with two parameters. One parameter will be used to specify the amount of data that you want to read, and the other parameter, which will have the *os.File type, will be used to access the desired file. The return value of that ...
Read now
Unlock full access