From the course: Go for Developers: Practical Techniques for Effective Coding

Unlock this course with a free trial

Join today to access over 24,900 courses taught by industry experts.

Dependency management

Dependency management

- While the Go Standard Library is a great starting point for building applications, it is not uncommon to reach out to other libraries to get the functionality we need. Go modules are designed to make it easy to import and use third party libraries, as well as create reliably reproducible builds. For example, here we're going to be importing the github.com/gobuffalo/flect module, which allows for various string manipulations. In this case, we're going to use the dasherize function to convert a string to an alphanumeric lowercase dashed string. In order to use the dasherize function, we have to first import the package using the import statement and the module's full name, github.com/gobuffalo/flect. Then we can access the dasherize function using the package identifier flect. When we try to run this application, however, we get a compilation error telling us that we need to add github.com/gobuffalo/flect to the module before we can use it. The easiest and idiomatic way to add third…

Contents