 Welcome back everyone. Today we're going to be writing a Hello World program using Go Lang. If you like this video, please like and subscribe for more and to help our channel grow. So to get started, I'm already in a test folder and there's nothing inside this test folder. I'm currently on Linux, but this will work exactly the same whether you're on Windows or Linux or OS X. In a prior video, we already showed you how to install Go Lang, the newest version. So if you haven't installed Go Lang yet, let's go ahead and do that. So in this folder, the first thing we need to do is actually create our Go file. So there's lots of different ways to do that. I actually prefer using Microsoft Code, but because this program is so simple and straightforward, I don't want to distract you with Microsoft Code. Instead, I will just use Nano. And Nano is just a normal text editor, command line text editor in Linux. If you're on Windows, you can use something like Notepad. Once you get more complicated programs, you will want to use a more advanced editing tool, but for now this will be okay. So since I've already called my folder Test, let's just imagine that I'm going to call my project test. So I'm going to write nano test.go. So my program will be called test. Okay, so enter. So now I have this empty file, this empty file called test.go. This is my source code. And the first thing I want to do is specify what type of package this is. So I need to specify package. And because I'm making a standalone program, I need to call it package main. Now, whenever it go compiles, it will look for this package main and say, because this is main, I'm going to make a binary out of this, I'm actually going to make a program. If instead you say something like package HTTP, then this whenever it compiles, it will know that this package is or this code is a library. So go differentiates between creating a binary, if it's package main, or just saying that this is part of a library, if it is package HTTP. Now, if you don't know what a library is yet, don't worry about it. We'll talk about that way later. It's kind of a little bit of an advanced concept. But for now, what we want to do is just have package main. And what this means is that we will create a program out of our source code. Okay. So the next thing we want to do is almost always with go, we want to import libraries, another library, and the main library that we want to import is format. So format is a really common library to import in go. Yeah, we just you just use it all the time because that's what we use to, for example, print results or print something to the screen whenever we want output. So import means that we will look for a library in go, take that library and then add it to our code. So someone else, specifically the go maintainers have already created a library some code that they called format. And we are saying we want to use that code inside of our code. Okay, so we import libraries, which is just other people's code that we're going to use in our code. Now, there is a go standard library that the maintainers of go created and they maintain. And then there are third party libraries that a lot of other people create that you can also import. We'll talk more about libraries and importing later. Okay, so now our our program is actually almost half done. This is a relatively straightforward program. So next we want funk, which it stands for function, and then main. And this is the entry point into the program. So we've already specified that this is the main binary package. This is the main package. We're importing one library. And then we have a function. And if you don't know what a function is yet, don't worry about it, we'll talk about that later. But we have our main function, which is essentially where the program begins. So whenever we double click a program, or we run it on the command line, this is the first function that will execute. So everything starts from main. Okay, and then next, we want to go in. And I'm going to use FMT. Remember, this is FMT from our library. So I'm basically calling someone else's code FMT. And then there's a function called print l in, which stands for print line. And then kind of standard thing to do is print line Hello, world. And I'm going to put digital forensics rocks, just to spice things up a little bit. Okay, so here we have function main, which is the main function of our program. That's where everything begins. And then the only thing we're doing here is we're saying, go to that other source code that that library that we're importing, and then use another function called print l in, which is print line. Well, what are we doing with that function? We're sending it. We're sending it some text Hello, world, digital forensics rocks. So what should happen? What do we expect to happen out of this? Well, if we run this program, the first thing that will happen, it will go into main, and then it will find print line, and it will print this text. And that's, that's pretty much it. Right. So now all we have to do is, if you're using nano do control O, and then file name to write test.go, hit enter, and then hit control X to exit. Now we have our file test.go. So now I want to run go, build test.go, hit enter. Now it's building if I do LS. Now I have this binary file created called test. Notice it's in green in Linux. So it's an executable. So if we do LS, LHA, you can see a little bit more about it. The test binary is to make. Now, why is that? That's because we imported some other code. So we've imported actually quite a lot of stuff. And as we built the program, go compiled everything together to make it completely self contained. So all of the code that's necessary to run the executable is in the executable now. Okay. So now all we have left to do is run the program. So in Linux, you do dot slash test. In Windows, I don't think you have to do dot slash, you can just type test.exe, but in Windows or OXS, O-S-X, then you can just do dot slash test, hit enter. And then hello world digital forensics rocks. Okay. And that's it for the hello world program. So next we'll talk about variables. Thank you very much. Thanks for watching. If this was helpful, please like and subscribe. Also, please consider supporting us on Patreon. Your support lets us focus on making better tutorials for everyone.