From the course: Learning Go

Get the exercise files from GitHub - Go Tutorial

From the course: Learning Go

Get the exercise files from GitHub

- [Instructor] Throughout this course I'll be using visual studio code but I'll be using exercise files that are available in a public repository on GitHub. This is the repository under the LinkedIn learning account. To use the repository go to this webpage, then click the code button and click this button to copy this URL to the clipboard. Now go to visual studio code. Within visual studio code you can close the welcome screen if you see it and then click this icon for source control. Click clone repository, and paste that URL into place. When you click on clone from GitHub you may be asked to log in to your GitHub account. And if that happens, go ahead and do it. And then you may be prompted to paste in that URL again. This time a dialogue should pop up asking you where you want to put your copy of the repository? I'm going to create a new folder under my home directory that I'll call GitHub, and then I'll choose select repository location. And it'll take a few moments for the repository to be downloaded from the GitHub website. Then I'll see this prompt to open the clone repository. Now, along the way you may be prompted to install additional plugins and other components, to support both GitHub and programming and go. If you see those offers accept them and download all the components that you need. Now to work through the exercises there are many branches in the repository. In visual studio code your branches are available from the button in the lower left corner and then a dropdown appears that shows you all the available branches. For each video, there'll typically be a beginning and an ending branch. Beginning is marked with a b, end is marked with an e. So for example, if I wanted to go to the third video in the fourth chapter, I would start with 0403b I'd open that and then I'd go to the directory where the code was and I'd click the main.go file to open it and I'd be ready to program. For most of the exercises you'll be working in the practice directory. For finished applications I've created special directories. So for example, there's a hello directory and there's a calculator directory as well. Those are applications you'll build along the way. Now as you make changes to your local files, you'll need to commit them to your local repository before you can go to another branch. I'll make a really simple change. I'll add a comment saying this is my change. I'll save that change and notice a number one appears on this icon. That's once again my source control icon, I'll click there and it'll show that there's been a change to main.go. I'll enter a message of some kind. This is called the commit message. I'll say I made changes. It can be anything you like. And then click the check mark and your changes will be saved locally. Now I can go back to my list of branches and I can open the branch for the next exercise, or I can open up the branch for the finished version of the current exercise. For the third video in chapter four that would be 0403e for n. if you work through the entire course, by the end you'll have a local repository that contains all of your solutions along with all of my solutions in the branches that end with the letter e.

Contents