This challenge will be to split up the new REST API application you have developed in Challenge 2 and utilize Go Modules.
Go Modules and the go mod tool have been deemed the official strategy for managing dependencies in your Go applications. Break up the existing application so that you create an entry point main.go file in the root of your directory as well as a sub-module which contains your endpoint code.
In order to successfully complete this challenge, your project will have to:
- Use Go Modules as a means of managing your dependencies
- Contain a
main.gofile which references a module
statswhich is contained within a
stats/stats.gofile within your project. This
stats/stats.gofile must contain the logic for collecting the hardware utilization stats from your machine and exposing them as a HTTP function.
- You will learn how to effectively break up your simple Go applications into larger, better structured applications using Go Modules as your dependency management system
Completing the Challenge
In order to complete the challenge, fork the elliotforbes/go-challenges repository into your own GitHub account.
Next, create a directory within that repo for each of the challenges you attempt! This will give you a super handy repo that will contain excellent references for your own future Go projects!
The following tutorials should help you to complete this challenge:
Congratulations! You have successfully completed the 3rd TutorialEdge Go Challenge!