My new course Building a Production-Ready Service in Go is almost complete - try it out and let me know what you think!

Video:

Project Setup

March 13, 2022

Course Instructor: Elliot Forbes

Hey Gophers! My name is Elliot and I'm the creator of TutorialEdge and I've been working with Go systems for roughly 5 years now.

In this video, we’ll be covering how to set up and initialize your project using both the go CLI as well as the git CLI.

Initializing Using go mod

Let’s start off by initializing our project using the go mod init command.

We’ll want to specify the GitHub repo location for our project within the command itself like so:

$ go mod init github.com/TutorialEdge/go-rest-api-course

Now, this will create our go.mod file that is effectively equivalent to the likes of a package.json file or a requirements.txt file that you would find in languages like JavaScript and Python.

Git Initialization

Now that we have our project initialized, let’s also ensure that we have initialized git within our directory and pointed it at the repository we are using for this project.

Note - You will want to replace this repo location with your own repository.

$ git init .
$ git remote add origin git@github.com/path/to/your/repo.git

As you progress through the course, try to ensure that you commit and push the code from each lesson up to your repository with a meaningful commit message that describes what the code changes do and why we are doing them.