今天就学习课程吧!
今天就开通帐号,24,700 门业界名师课程任您挑!
Packages and visibility
- [Instructor] So far, we've only worked with Go standard library. Since Go ships with it out of the box, we haven't had to retrieve anything outside of that, but as you no doubt will come across and want to work with third-party private and open source packages, it's worth learning about them here. Before we can import third-party packages into our programs, we must first understand how Go treats dependencies. Go uses the concept of a module to encapsulate a collection of packages. I'll link the in-depth Go blog article in the README, but for now, we'll cover just the basics we need. You can always tell a module by the go.mod file that exists at the root of that project. For example, the source code repository for this course is a module. Let's open up its go.mod file located at the root. In the go.mod, we see the module declaration at the top with its module path. A module's path is what is used to import it…