Golang installation & configuration

Federico León
A free video tutorial from Federico León
Technical Leader
4.3 instructor rating • 4 courses • 8,646 students

Lecture description

After this lesson you'll have the Go programming language configured in your computer and ready to start working!

Learn more from the full course

Introduction to industry REST microservices in Golang (Go)

Everything you need to get serious about microservices design & development in Golang: From design to production metrics

15:45:02 of on-demand video • Updated April 2020

  • Install, configure and setup Go
  • Analysis and design of REST microservices.
  • Different architectures and patterns for implementing them in Go.
  • Test as you Go. Ensure the quality of your work.
  • Advanced concurrency patterns.
  • Parallel execution on Multi-Core VMs.
  • HTTP frameworks, comparison and appliance.
  • Consuming external APIs. Test them. Mock them. Measure them. Use them.
  • The ultimate and best way of mocking different layers of your application.
  • Debugging and completely testing your application.
  • Create native webservices.
English [Auto] Welcome again to this new video where we are going to cover how you can tell me go from scratch. OK you are going to install will go from scratch. So as you can see if I go into the console and I type gold version you'll see that I don't have the go programming language installed. So this is pretty much your situation right now. So we're going to install go from scratch for doing these are going to go low or there you go. And here you have. Don't let go. Here you have different options for e-filing. Go as you can see have a go for Windows McCoy is Linux and the great feature that Goh has is that you can execute the same code in the same go code in different operating systems. Okay. This is pretty much like Java actually you can execute the very same source code on different operating systems. So in this case you have to go one point twelve point seven. This is the latest version that they have at this moment. But you also have this source a soul that you have here that the binary sexually and you have different choices. You can use a the installer or a directly. This will install go in your environment without you to configure anything but you also have this approach that is using the this horoscope for these days you're going to start by using the installer but later we are going to see how you can have different versions of go running in the same machine and how you can change them by just running our command on the console. So for now let's start by downloading these these Storify that we have. OK. It is four minutes to download. So this is how magic happens. OK. We're going to just double click on it and as you can see it opens the installer for the go programming language. And it's pretty pretty easy to follow. So basically you have these. We know that you can just click on continue install for all the users and just install. So you cannot put your password there and there you go. So congratulations you have. Go install in your computer. So basically how this works and some of the features that we have installed without already knowing this. So basically go has two different variables that we need to configure in order to use it. The first one is they go rogue. OK you have a PDA attach today to the course. But in here West you are just using sublime in order to display this OK. So there you go and we can it's gorgeous. So basically we have two main variables that we need to configure. First one being go rogue. So the growth is where you have install it go. This is where it go. It's actually installed and running. OK. The second variable that you need to configure is the gold bar. So they go but is where every go purple goes so they go south east where every go report that you are working on goes. So this is the workspace of go. So for you to have an idea every new project that you start working with needs to go into your gold path. OK. So when you install gold by using the installer these two a variables are configure already for you. So the growth usually points to user local go and they go but usually points to problems at school. So now if we run a version we see that we have go one point twelve and that's perfect because it is the latest version that they have. So if I go to growth you see that this bird was not configured yet in the console. So if what it use which go you will see that you have user local go. So if you go to use a local go here you have the entire source code of go. And this is the actual version that you are using. So if you need to only uninstall go what you can actually do is just removing these folder here and that's it. That's all it takes for uninstalling go from your computer. So if you want to have different versions of go what you can do is actually installing them in user. Look I'll go slash one a one point twelve one point nine one point eleven and then just change your go rule a will on the fly by using a shell command or actual function actually inside your your profile you can define a function to change the go rogue according to the version you want to use so let's try and let's test our installation. OK. So we're going to create a very basic halo for example logo. So we have deep pockets deep pockets Main. In this case the package mean we're going to create a functional code mean. And in here we're going to say for month that print land and we need to import. We need to import import and export there we go. We have our main that go and this is our first hello world example in Congo. So a few comments on these for you to have an idea. This is the first time do you see some go cold. So for you to have an idea every go fight starts with a comment in places simple Hello OK. So every go fight start always starts with a comment or a package definition. So the entry point of any go up allegation that you're making is the main function inside the main package. So as you can see we have it the way for defining functions and go is actually using func and then the function's name the the parameters that we accept and the response type here. But we are going to keep that for later. So let's this these installations that we have. So I move this file to this though. So there you go. And since you can see we have domain that go in. So how can we do for running these file. We have two options. The first one is can go run mean that and there you go. He'll award and go your course he'll award awarding go the other one being go build me that go. What happens when we say go build. Actually you see that we know we have a main file that we can just execute here so when you execute things like go build and the main file that you want to you want to build or any file that you want to build go actually build these file compiled its files and makes and execute an acceptable file call with the same name that you have on the file that you're built. Basically if you want to change the name of the file you can do the minimum the slash output and say go Bill slash Oh a a word OK. And as you can see you have the work and you can do things like just execute the halo work. So this is our first go file and that we have implement. So this is the way that we have in order for a game for us to to compile anew. And you go file or execute a goal right. Basically when you run and go run main that goal what go actually does is building the file and then executing the the output builds but it doesn't generate an acceptable file in that desk to get it to be exploited and explicit and say go Bill because you want to build this file. So this is our first is first example on our first goal file that we have after installing go from scratch. So this is pretty much everything you need to know for now. We're going to keep covering deeper topics as long as we move into the language and what what it offers and what we are using. But for now let's keep it simple and just have it company installed by using these stolen file downloaded from from go. So there you go. And that or and you can just download any version that you want. So you have these versions here you have all the history and all the cheapest versions. So go to your computer and download the version that you want and follow these steps in order to make sure that the installation process that you follow actually works. And that's pretty much it. So in the next video we're going to cover some of the basic features go bad. I will leave that for later. So I really hope this video helps you in order to configure installing a computer and this can go into your into system. OK see you next time.