Consuming multiple modules within a project
You can consume multiple Go modules within a project. Just as you saw with the Google module example earlier, you can use that module alongside other Go modules that you may need in your project.
Activity 9.01 – consuming multiple modules
In this activity, we will use multiple Go modules within our code:
- Create a new UUID and print the UUID.
- Fetch and print a random quote using the
rsc.io/quote
module.
Your output should look like this, with a different UUID and a different random sentence for your second line:
Generated UUID: 3c986212-f12d-415e-8eb5-87f61a6cbfee Random Quote: Do not communicate by sharing memory, share memory by communicating.
Note
The solution for this activity can be found in the GitHub repository folder for this chapter: https://github.com/PacktPublishing/Go-Programming-From-Beginner-to-Professional-Second-Edition-/tree/main/Chapter09/Activity09.01.