Learn how to manage dependencies or requirements with the mod command of the Go tool. See how to write go.mod and how to fix requirements to a specific version.
- The Go Get tool installs one dependency at a time. And it…installs the latest version of the package.…When working as a team, we'd like a way to document…dependencies and their versions.…Using a specific version of the package will also protect…you from breaking changes the package might have.…In Go 111, we got a new mod tool to handle…dependency management. It is still considered an…experimental tool but is the evolution of several…dependency management tools for Go and is the new official…tool from the Go team.…
Let's say we'd like to work with toml in our code.…To start, we need to create a module.…We'll run go, (typing) mod, (typing) init (typing)…and will give it the name of the package.…And Go will tell us we created the new Go dot modifier.…Let's have a look at this file.…(typing)…This file currently just have the name of the module.…Let's add the requirements. We're adding a requirement…so we say require, we say the name of the package, which…is the go-toml package, and we say the version…of the package.…
- Go basic types, conditionals, and loops
- Go functions
- Object-oriented programming with Go
- Error handling
- Concurrent programming with channels
- Testing and project management
- Networking with JSON and HTTP
Skill Level Beginner
Programming Foundations: Fuzzy Logicwith Erin Colvin41m 50s Intermediate
Getting started1m 34s
1. Getting Started
2. Go Basics
5. Error Handling
7. Project Management
Next steps1m 12s
- Mark as unwatched
- Mark all as unwatched
Are you sure you want to mark all the videos in this course as unwatched?
This will not affect your course history, your reports, or your certificates of completion for this course.Cancel
Take notes with your new membership!
Type in the entry box, then click Enter to save your note.
1:30Press on any video thumbnail to jump immediately to the timecode shown.
Notes are saved with you account but can also be exported as plain text, MS Word, PDF, Google Doc, or Evernote.