Fireship · @fireship
Go in 100 Seconds
Uploaded October 7, 2021 · Length 2:30
Summary
go language basics: installation, syntax, concurrency, and more in 100 seconds.
- go language
- programming language
- statically typed
- compiled language
- concurrency
Transcript preview
The first 2 minutes of the transcript. Select a timestamp to watch that moment on YouTube.
- 0:00
go a statically typed compiled language
- 0:03
often described as C for the 21st
- 0:05
century it's a popular choice for high
- 0:07
performance serers side applications and
- 0:09
is the language that built tools like
- 0:11
Docker cockroach DB and dgraph it was
- 0:14
created at Google in 2007 by Legends who
- 0:17
really know their stuff like Ken
- 0:19
Thompson the inventor of the B and C
- 0:21
programming languages version 1.0 was
- 0:23
released as open-source software in 2012
- 0:26
it was designed for Simplicity and
- 0:28
efficiency and that's why we call it go
- 0:30
and not go Lang the source code is
- 0:32
compiled down to machine code which
- 0:34
means it generally outperforms
- 0:35
interpreted languages but it's famous
- 0:37
for its extremely fast compile times
- 0:39
made possible by Innovations to
- 0:41
dependency analysis and even though it's
- 0:43
a statically typed language it performs
- 0:45
type inference to deliver a syntax that
- 0:47
is very concise and practical it also
- 0:49
has a package and module system making
- 0:51
it easy to Import and Export code
- 0:54
between projects to get started install
- 0:56
go and then open an empty directory on
- 0:58
your system create a file ending and.go
- 1:01
then add package main at the top to
- 1:03
create a standalone executable then
- 1:05
declare a main function which is where
- 1:07
your program will start executing go has
- 1:10
a standard library of core packages to
- 1:12
handle common requirements like math
- 1:14
networking or formatted IO by importing
- 1:17
fmt we can print a line to the standard
- 1:19
output then run the go build command and
- 1:22
it quickly compiles the source code and
- 1:24
dependencies into an executable binary
- 1:26
when it comes to dependencies we can
- 1:28
also link to remote packages on GitHub
- 1:30
run go mod a knit from the command line
- 1:32
and that creates a go module file that
- 1:34
enables dependency tracking
- 1:35
syntactically go is like a concise
- 1:37
version of C or C++ declare a variable
- 1:40
with the VAR keyword followed by its
- 1:42
name and type and initialize it with a
- 1:44
value or you might use the short
- 1:46
assignment syntax to replace VAR and let
- 1:48
go automatically infer the type and you
- 1:51
can Define multiple variables from a
- 1:52
single line go has all the other
- 1:54
features you would expect in a
- 1:55
programming language like arrays Maps
- 1:57
loops and control flow but also allows
- 1:59
you to store the memory address of a


