Developing for Different Platforms
One of the main reasons Go is such a powerful language for building a command-line application is how easy it is to develop an application that can be run on multiple machines. Go provides several packages that allow developers to write code that interacts with the computer independent of the specific operating system. These packages include os
, time
, path
, and runtime
. In the first section, we will discuss some commonly used functions in each of these packages and then provide some simple examples to pair with the explanations.
To further drill down the importance of these files, we will revisit the audiofile
code and implement a couple of new features that utilize some of the methods that exist in these packages. After all, the best way to learn is by implementing new features with the new functions and methods you’ve learned about.
We will then learn how to use the runtime
library to check the operating system the application is running...