Press "Enter" to skip to content

Introduction – Go Lang Practical Programming Tutorial p.1


what’s going on everybody and welcome to

what’s going on everybody and welcome to a go programming tutorial series this

a go programming tutorial series this

a go programming tutorial series this tutorial series is going to be practical

tutorial series is going to be practical

tutorial series is going to be practical and applied but also over the basics of

and applied but also over the basics of

and applied but also over the basics of go the reason why I want to do it that

go the reason why I want to do it that

go the reason why I want to do it that way is because the go programming

way is because the go programming

way is because the go programming language I mean all programming

language I mean all programming

language I mean all programming languages are like this but the go

languages are like this but the go

languages are like this but the go programming language because it’s kind

programming language because it’s kind

programming language because it’s kind of a low-level programming language it’s

of a low-level programming language it’s

of a low-level programming language it’s kind of the case that you could go

kind of the case that you could go

kind of the case that you could go through a basics tutorial for something

through a basics tutorial for something

through a basics tutorial for something like go and feel like you kind of

like go and feel like you kind of

like go and feel like you kind of understood what was going on and then

understood what was going on and then

understood what was going on and then you actually go to try to apply it to a

you actually go to try to apply it to a

you actually go to try to apply it to a project or something and you’re like I

project or something and you’re like I

project or something and you’re like I have no idea how to do this right so so

have no idea how to do this right so so

have no idea how to do this right so so my hope is that each time we learn

my hope is that each time we learn

my hope is that each time we learn something we’re going to apply it to an

something we’re going to apply it to an

something we’re going to apply it to an overarching objective and project and my

overarching objective and project and my

overarching objective and project and my hope is that that’ll that’ll make

hope is that that’ll that’ll make

hope is that that’ll that’ll make learning go much much simpler but still

learning go much much simpler but still

learning go much much simpler but still even at the end of that the best way to

even at the end of that the best way to

even at the end of that the best way to learn something is to keep trying to use

learn something is to keep trying to use

learn something is to keep trying to use it to solve various types of tasks so

it to solve various types of tasks so

it to solve various types of tasks so some of that’s actually still going to

some of that’s actually still going to

some of that’s actually still going to be on you but hopefully I can make some

be on you but hopefully I can make some

be on you but hopefully I can make some of that initial process easier so first

of that initial process easier so first

of that initial process easier so first of all why go why would someone like me

of all why go why would someone like me

of all why go why would someone like me be interested and go why might you be

be interested and go why might you be

be interested and go why might you be interested and go basically go is built

interested and go basically go is built

interested and go basically go is built from the ground up it was built by

from the ground up it was built by

from the ground up it was built by Google it was built to solve Google

Google it was built to solve Google

Google it was built to solve Google types of problems right so basically go

types of problems right so basically go

types of problems right so basically go is for scale this would be like a

is for scale this would be like a

is for scale this would be like a systems language web development

systems language web development

systems language web development language anything you want to scale

language anything you want to scale

language anything you want to scale anything you want to be super efficient

anything you want to be super efficient

anything you want to be super efficient but you might not want to write in C++

but you might not want to write in C++

but you might not want to write in C++ so for example the reason I’m interested

so for example the reason I’m interested

so for example the reason I’m interested in go is mainly for web development so a

in go is mainly for web development so a

in go is mainly for web development so a website like Python programming net for

website like Python programming net for

website like Python programming net for example it’s built in Python using flask

example it’s built in Python using flask

example it’s built in Python using flask and it’s not the slowest website in the

and it’s not the slowest website in the

and it’s not the slowest website in the world but it’s also not the fastest

world but it’s also not the fastest

world but it’s also not the fastest website in the world it could we could

website in the world it could we could

website in the world it could we could make some serious speed gains there and

make some serious speed gains there and

make some serious speed gains there and in web development the difference of 100

in web development the difference of 100

in web development the difference of 100 mil or 100 milliseconds is a major

mil or 100 milliseconds is a major

mil or 100 milliseconds is a major difference especially when you scale

difference especially when you scale

difference especially when you scale that out to millions of users so it you

that out to millions of users so it you

that out to millions of users so it you know the speed doesn’t just affect user

know the speed doesn’t just affect user

know the speed doesn’t just affect user the user experience but it also affects

the user experience but it also affects

the user experience but it also affects your bottom line how much are you paying

your bottom line how much are you paying

your bottom line how much are you paying for processing cost basically right in

for processing cost basically right in

for processing cost basically right in hosting time and all of that so anywhere

hosting time and all of that so anywhere

hosting time and all of that so anywhere you can make gains in web development

you can make gains in web development

you can make gains in web development it’s usually a very good thing and then

it’s usually a very good thing and then

it’s usually a very good thing and then the bigger the scale the better those

the bigger the scale the better those

the bigger the scale the better those are for you also in terms of just

are for you also in terms of just

are for you also in terms of just anything where you need it to be super

anything where you need it to be super

anything where you need it to be super fast or super efficient go is pretty

fast or super efficient go is pretty

fast or super efficient go is pretty much C++ speeds so anywhere well that’s

much C++ speeds so anywhere well that’s

much C++ speeds so anywhere well that’s a good thing to you maybe you’re in

a good thing to you maybe you’re in

a good thing to you maybe you’re in high-frequency trading or something like

high-frequency trading or something like

high-frequency trading or something like that where you you really want to be as

that where you you really want to be as

that where you you really want to be as quick as possible but maybe you don’t

quick as possible but maybe you don’t

quick as possible but maybe you don’t want to write something as tedious as C

want to write something as tedious as C

want to write something as tedious as C so go is gonna be static typed like C++

so go is gonna be static typed like C++

so go is gonna be static typed like C++ unlike Python so every time like in

unlike Python so every time like in

unlike Python so every time like in Python every time the interpreter hits a

Python every time the interpreter hits a

Python every time the interpreter hits a variable has to kind of figure out what

variable has to kind of figure out what

variable has to kind of figure out what is that variable and that variable could

is that variable and that variable could

is that variable and that variable could change types and stuff like that and by

change types and stuff like that and by

change types and stuff like that and by that I mean like int sand floats and

that I mean like int sand floats and

that I mean like int sand floats and strings stuff like that

strings stuff like that

strings stuff like that whereas in go that’s not the case so it

whereas in go that’s not the case so it

whereas in go that’s not the case so it doesn’t need to know all there it

doesn’t need to know all there it

doesn’t need to know all there it doesn’t it basically doesn’t need to

doesn’t it basically doesn’t need to

doesn’t it basically doesn’t need to figure those things out for you

figure those things out for you

figure those things out for you basically you are gonna tell it what

basically you are gonna tell it what

basically you are gonna tell it what type is what type is certain variables

type is what type is certain variables

type is what type is certain variables and all that kind of stuff so that’s

and all that kind of stuff so that’s

and all that kind of stuff so that’s going to give you some speed also it was

going to give you some speed also it was

going to give you some speed also it was just built from the ground up for

just built from the ground up for

just built from the ground up for concurrency whereas Python was kind of

concurrency whereas Python was kind of

concurrency whereas Python was kind of Python was built from the ground up to

Python was built from the ground up to

Python was built from the ground up to be a teaching language right and it just

be a teaching language right and it just

be a teaching language right and it just so happens that it’s so fun and so easy

so happens that it’s so fun and so easy

so happens that it’s so fun and so easy to program with that it got really

to program with that it got really

to program with that it got really really popular but that’s what Python

really popular but that’s what Python

really popular but that’s what Python was made for so pythons got the global

was made for so pythons got the global

was made for so pythons got the global interpreter lock kind of restricting it

interpreter lock kind of restricting it

interpreter lock kind of restricting it to one thread yes there are ways around

to one thread yes there are ways around

to one thread yes there are ways around that but that’s like band-aids over a

that but that’s like band-aids over a

that but that’s like band-aids over a bigger issue whereas go is just

bigger issue whereas go is just

bigger issue whereas go is just concurrent right out of the box so stuff

concurrent right out of the box so stuff

concurrent right out of the box so stuff like that is what’s gonna make go faster

like that is what’s gonna make go faster

like that is what’s gonna make go faster but go is much more pleasant to write

but go is much more pleasant to write

but go is much more pleasant to write then something like C++ anyways with

then something like C++ anyways with

then something like C++ anyways with that let’s go ahead and get into it I

that let’s go ahead and get into it I

that let’s go ahead and get into it I think you’ll learn a lot more about

think you’ll learn a lot more about

think you’ll learn a lot more about whether or not you like go by actually

whether or not you like go by actually

whether or not you like go by actually using go and seeing what you think from

using go and seeing what you think from

using go and seeing what you think from there so to get go it’s just go to

there so to get go it’s just go to

there so to get go it’s just go to golang.org head to the downloads and

golang.org head to the downloads and

golang.org head to the downloads and download whatever fits your needs so if

download whatever fits your needs so if

download whatever fits your needs so if you’re on Windows it’s just a simple

you’re on Windows it’s just a simple

you’re on Windows it’s just a simple Installer on Mac I have no idea its

Installer on Mac I have no idea its

Installer on Mac I have no idea its package I don’t know how installing

package I don’t know how installing

package I don’t know how installing that’s going to go for you I don’t use

that’s going to go for you I don’t use

that’s going to go for you I don’t use Mac and then on Linux it’s a total

Mac and then on Linux it’s a total

Mac and then on Linux it’s a total download that install that the only

download that install that the only

download that install that the only thing I’ll add is on Linux you’ll want

thing I’ll add is on Linux you’ll want

thing I’ll add is on Linux you’ll want to go ahead and export that path

to go ahead and export that path

to go ahead and export that path permanently if you don’t know how to do

permanently if you don’t know how to do

permanently if you don’t know how to do that I’ll put a link in the description

that I’ll put a link in the description

that I’ll put a link in the description to the tech space right up in this

to the tech space right up in this

to the tech space right up in this tutorial and you can head there for

tutorial and you can head there for

tutorial and you can head there for instructions on how to set it up on

instructions on how to set it up on

instructions on how to set it up on Linux a little more easily

Linux a little more easily

Linux a little more easily other than that you’re gonna need some

other than that you’re gonna need some

other than that you’re gonna need some sort of editor I’m gonna be using

sort of editor I’m gonna be using

sort of editor I’m gonna be using sublime text people like to make big

sublime text people like to make big

sublime text people like to make big deals about editors you can use whatever

deals about editors you can use whatever

deals about editors you can use whatever you want you can use notepad for that

you want you can use notepad for that

you want you can use notepad for that matter it doesn’t really matter sublime

matter it doesn’t really matter sublime

matter it doesn’t really matter sublime text is a great editor though so you can

text is a great editor though so you can

text is a great editor though so you can use that if you want that’s what I’m

use that if you want that’s what I’m

use that if you want that’s what I’m gonna be using and let’s go ahead and

gonna be using and let’s go ahead and

gonna be using and let’s go ahead and write our very first go program so I’m

write our very first go program so I’m

write our very first go program so I’m gonna go ahead and move this out of the

gonna go ahead and move this out of the

gonna go ahead and move this out of the way and I’ve just got a simple directory

way and I’ve just got a simple directory

way and I’ve just got a simple directory called go tux so I’m going to go ahead

called go tux so I’m going to go ahead

called go tux so I’m going to go ahead and just make a new file and I’m just

and just make a new file and I’m just

and just make a new file and I’m just gonna call it go to go yes we’re gonna

gonna call it go to go yes we’re gonna

gonna call it go to go yes we’re gonna open that up and we’re gonna get ready

open that up and we’re gonna get ready

open that up and we’re gonna get ready so the first thing in every go program

so the first thing in every go program

so the first thing in every go program it’s gonna be a part of a package and

it’s gonna be a part of a package and

it’s gonna be a part of a package and for the most part you’re gonna find

for the most part you’re gonna find

for the most part you’re gonna find yourself pretty much writing package

yourself pretty much writing package

yourself pretty much writing package mean every time until you start writing

mean every time until you start writing

mean every time until you start writing bigger things

bigger things

bigger things so package main and then you’re gonna

so package main and then you’re gonna

so package main and then you’re gonna have your imports for now we’re just

have your imports for now we’re just

have your imports for now we’re just going to import fmt and all your imports

going to import fmt and all your imports

going to import fmt and all your imports go in double quotes and something to get

go in double quotes and something to get

go in double quotes and something to get used to especially if you’re coming from

used to especially if you’re coming from

used to especially if you’re coming from Python which I assume many people

Python which I assume many people

Python which I assume many people viewing this or from my channel mainly

viewing this or from my channel mainly

viewing this or from my channel mainly watch Python you have to use double

watch Python you have to use double

watch Python you have to use double quotes also you’re putting quotes around

quotes also you’re putting quotes around

quotes also you’re putting quotes around your imports but get rid of single

your imports but get rid of single

your imports but get rid of single quotes you’re gonna be done using them

quotes you’re gonna be done using them

quotes you’re gonna be done using them with with go also if I if I slip up and

with with go also if I if I slip up and

with with go also if I if I slip up and call go python and all that kind of

call go python and all that kind of

call go python and all that kind of stuff I’m sorry it’s gonna happen I’m

stuff I’m sorry it’s gonna happen I’m

stuff I’m sorry it’s gonna happen I’m also probably gonna type like print a

also probably gonna type like print a

also probably gonna type like print a few times I’m also gonna make quite a

few times I’m also gonna make quite a

few times I’m also gonna make quite a few pun puns about go so get used to it

few pun puns about go so get used to it

few pun puns about go so get used to it so once you’ve done your imports we’re

so once you’ve done your imports we’re

so once you’ve done your imports we’re just gonna import fmt which is like

just gonna import fmt which is like

just gonna import fmt which is like format basically it’s gonna be how we

format basically it’s gonna be how we

format basically it’s gonna be how we can print something out basically we’re

can print something out basically we’re

can print something out basically we’re ready to build out our functions so to

ready to build out our functions so to

ready to build out our functions so to actually write a function you’re gonna

actually write a function you’re gonna

actually write a function you’re gonna say func that just start your function

say func that just start your function

say func that just start your function you’ve got your function name

you’ve got your function name

you’ve got your function name you’ve got parameters and then the

you’ve got parameters and then the

you’ve got parameters and then the function comes after that

function comes after that

function comes after that again it’s not Python unfortunately

again it’s not Python unfortunately

again it’s not Python unfortunately we’ve got braces so like many other

we’ve got braces so like many other

we’ve got braces so like many other languages so and then in here you write

languages so and then in here you write

languages so and then in here you write your code we’re just gonna have some

your code we’re just gonna have some

your code we’re just gonna have some simple code it’s just going to be FM T

simple code it’s just going to be FM T

simple code it’s just going to be FM T capital P print line and then we’re just

capital P print line and then we’re just

capital P print line and then we’re just going to say again in double quotes

going to say again in double quotes

going to say again in double quotes don’t use single quotes anymore welcome

don’t use single quotes anymore welcome

don’t use single quotes anymore welcome to go awesome so we can go ahead and

to go awesome so we can go ahead and

to go awesome so we can go ahead and save that and let’s run this program

save that and let’s run this program

save that and let’s run this program real quick so we’re going to come

real quick so we’re going to come

real quick so we’re going to come here I’m gonna open up the command line

here I’m gonna open up the command line

here I’m gonna open up the command line and to run it you just do go run and

and to run it you just do go run and

and to run it you just do go run and then whatever the file name is so for me

then whatever the file name is so for me

then whatever the file name is so for me it’s go touch go go hey dinner and but

it’s go touch go go hey dinner and but

it’s go touch go go hey dinner and but welcome to go so that’s going to go

welcome to go so that’s going to go

welcome to go so that’s going to go ahead and compile and run it for you at

ahead and compile and run it for you at

ahead and compile and run it for you at the same time so so that’s that not too

the same time so so that’s that not too

the same time so so that’s that not too much I really want to cover here until

much I really want to cover here until

much I really want to cover here until we get to the next tutorial like I said

we get to the next tutorial like I said

we get to the next tutorial like I said there’s just like a little things that

there’s just like a little things that

there’s just like a little things that you’ll have to get used to also you

you’ll have to get used to also you

you’ll have to get used to also you might be wondering why did the main

might be wondering why did the main

might be wondering why did the main function even run like we didn’t ask it

function even run like we didn’t ask it

function even run like we didn’t ask it to run great question so we’ll be

to run great question so we’ll be

to run great question so we’ll be talking about stuff like that in the

talking about stuff like that in the

talking about stuff like that in the next tutorial also be explaining a lot

next tutorial also be explaining a lot

next tutorial also be explaining a lot of little smaller things here that you

of little smaller things here that you

of little smaller things here that you might not have noticed if you have

might not have noticed if you have

might not have noticed if you have questions comments concerns go puns

questions comments concerns go puns

questions comments concerns go puns whatever feel free to steam them below

whatever feel free to steam them below

whatever feel free to steam them below otherwise I’ll see you in the next

otherwise I’ll see you in the next

otherwise I’ll see you in the next tutorial

”

Be First to Comment

Leave a Reply

Your email address will not be published. Required fields are marked *