© The Author(s), under exclusive license to APress Media, LLC, part of Springer Nature 2022
A. FreemanPro Gohttps://doi.org/10.1007/978-1-4842-7355-5_12

12. Creating and Using Packages

Adam Freeman1  
(1)
London, UK
 
Packages are the Go feature that allows projects to be structured so that related functionality can be grouped together, without the need to put all the code into a single file or folder. In this chapter, I describe how to create and use packages and how to use packages developed by third parties. Table 12-1 puts packages in context.
Table 12-1

Putting Packages in Context

Question

Answer

What are they?

Packages allow projects to be structured so that related features can be developed together.

Why are they useful?

Packages are how Go implements ...

Get Pro Go: The Complete Guide to Programming Reliable and Efficient Software Using Golang 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.