Learn to Code Go in 17 minutes | Golang Programming Crash Course

preview_player
Показать описание
Welcome to this Crash Course in Go! Now if you’re here you’ve probably heard some good things about Go - low number of keywords in the language, which allows it to be picked up easily and intuitively like an interpreted language like python, while still being fast like C++. And all those cool concurrency features makes it a very good language for efficient software!

This video, of course in no way comprehensive of EVERY feature of Go, but enough to get you started!

Join this channel to get access to perks like behind the scenes and support my channel!
or the same perks over on Patreon:

Chapters:
0:00 Why Go?
0:34 Install Go & Jetbrains Goland
1:05 Packages, imports, main, and print
2:29 Basic Types & Operators
4:19 Composite Types: Arrays and Slices
7:02 Maps
8:07 Structs
8:58 Control Flow: If
9:26 Switch
9:58 For loops
10:44 Functions
11:25 Methods
11:49 Interfaces
13:27 Empty Interfaces
14:16 Goroutines & Channels

Resources to learn more Go!

Go programs are organized into packages. A package is a collection of source files in the same directory that are compiled together.

You can use gofmt or goimports tool to sort imports, and in Goland you can set up a file watcher in preferences with gofmt and go imports.

Go's basic types:
Bool
String
Int and uint - signed and unsigned integers
float

And variations with different bit sizes
You can have int8, 16, 32, and 64, and unsigned ints uint8, 16, 32, and 64

Unsigned ints are only positive values, while signed ints range from negative to positive

Int32 is also called a “rune”
And a byte is the same as uint8

You can apply basic mathematical operators and comparisons to numeric types, so add numbers together, multiply, compare greater than, less than, and bitwise binary operators.

Strings can also be concatenated with a plus sign.

We can then combine these basic types into composite types!

Arrays is a sequence of elements of one type, and it’s a fixed length.

Slices are similar to arrays, but they can vary in length. You write it the same way as an array, but do not specify the number of elements.

Slices are really just pointers to an underlying array with a length and capacity, but they can grow in that length and capacity. The length is how many elements the slice has, the capacity is how much memory or space is available for elements. So a slice with a length of 3 has 3 elements in it, but may have a capacity that’s larger so you can add elements to it without having to expand the memory. This actually leads to interesting performance implications.

The crucial thing we can do with a slice is APPEND.

Like most languages, Golang has an if statement, switches, and for loops. However, Go does not have while loops!

A method is a function, but it also has a receiver argument, so which type it’s attached to.
We can also have an empty interface.

If we don’t know what types we’re going to get back, the empty interface can have any value assigned to it. You can think of an interface of holding the value, and the type.

Goroutines are similar to threads, but much cheaper, that can spin off and do their own thing.
Channels communicate between goroutines. Why do goroutines need to communicate? Well, we need to know when goroutines are done, and when we need to wait or continue.

Go routines and channels is where programming really gets interesting. A lot of programming is very sequential, and goroutines and channels can spin off operations while other code runs. It’s SUPER powerful!

Disclaimer: Affiliate links may be used in my recommendations! If you buy through my links I provide, I may receive a portion of the sale amount. This doesn't change the price you pay.

#golang #programming #learntocode
Рекомендации по теме
Комментарии
Автор

This is awesome Anastasia! As a Go developer you covered quite a bit. Really good resource for someone being introduced to go!

DThompsonDev
Автор

Wow now i know go, love how fast you go through everything. Skipping the Hello World routine was genius.

aelxkethdam
Автор

14:20 every YouTube explainer needs to watch this sequence. She took the time to concisify nearly a minute of continuous instruction. No filler words: just good use of my time. God Bless you 🙏🏼

ScriptureFirst
Автор

Damn! I never realized how bad videos that explain everything at nausea are. This faster approach was definitely better. I was wondering about golang and didn't really wanna sit through an enormous tutorial and this was straight and on the point. Maybe not so good for people who are just getting into programming but I guess you wouldn't get into go at that point

TheStefanGenov
Автор

Appreciate The Recent effort and Content that u put through ur video..simple and straight forward no time-wasting 💓. You've been killin' it 👍👍🙏🙏

barindersingh
Автор

As an experienced Go programmer myself, I must say you did a good job! You even warned about the random iteration order with maps, that was a nice touch I was expecting if this was high quality content, and you delivered!

joonasfi
Автор

Just 17 mins is all she needs. Muchas gracias. ♠️

sangeethshaju
Автор

This tutorial is amazing for someone like me who re-bounces to Go and want a refresh instead of rereading the docs. The pace is on spot, the speech is clear. Amazing job, well done! We need more women in tech please!

thinksiamallamacom
Автор

The most informative description box I have ever seen. thank you for the video.

bopon
Автор

amazing, straight forward without wasting time.
Go feels so good daddy.

sadclown
Автор

Excellent content and delivery Anastasia for anyone requiring a 30 minute recap (so one can stop a few times to think!) before delving back into Go programming.

russelfernandes
Автор

Thanks for the quick overview ! a simple web app with Go would be cool !

melkaouianas
Автор

Expecting the usual explainer's pace I initially cranked up the playback speed, BIG MISTAKE! Packed with well-explained, useful info, great video!

stevenazar
Автор

Excellent introduction to a new language. We need this for all major languages.

rineeshparai
Автор

Wonderful video, from data types to channels passing interfaces, structures and simple operators. You have the ability to simplify and condense a lot information, with easy to understand examples, excellent video thanks for sharing

matobago
Автор

Finally a person who delivers only relevant information and in the right pace! This is so great - thank you! спасибо большое :-)

JK-bxut
Автор

Being bumping into go of late, nice tutorial to get one started.

kombi
Автор

Great video! I really needed a reminder of what an interface is.
I still have a couple of questions, if you are willing to answer:

1) Do you have a (professional) preference between C++ and Golang ?
2) Would an assembly language, such as x86, see much use when dealing with quantum computer programming ?

As a footnote, I would like to congratulate you for keeping a great balance between conciseness and technical details in the video. Made me download Golang and give it a try.

kent_hdd
Автор

Beautiful Video !! Reignited and inspired me to learn Go. Surely one of the best crash courses on Go.

satyapraneethkatta
Автор

This is really nice video . Worked with go couple of months ago and yeah this some serious content for learning and revising .... thanks a lot ....

aabidsofi
join shbcf.ru