Chapter 8. Standard library
In this chapter
- Writing output and logging information
- Decoding and encoding JSON
- Working with IO and streams of data
- Interoperability between packages in the standard library
What is the Go standard library and why is it important? The Go standard library is a set of core packages that enhance and extend the language. These packages add to the number of different types of programs you can write without the need to build your own packages or download packages others have published. Since these packages are tied to the language, they come with some special guarantees:
- They will always exist for each minor release of the language.
- They will honor the backward-compatibility promise.
- They are part of the dev, build, and release process for Go.
- They are maintained and reviewed by Go contributors.
- They are tested and benchmarked with each new release of the language.
These guarantees make the standard library special and something you want to leverage as much as possible. By using packages from the standard library, you make it easier to manage your code and ensure that it’s reliable. This is because you don’t have to worry if your program is going to break between release cycles, nor do you have to manage third-party dependencies.