
How to declare a variable
Parts of a variable declaration syntax
Naming rules
Path package
Path.Split function
Function declaration syntax
Using blank-identifier with multiple result returning expressions
Recommendations about when to use a short declaration vs a variable declaration.
Code examples
How to change the type of a value to another type?
Type conversion expression syntax
Importance of the order of type conversions
Rules
Getting arguments from the command-line
os Package and os.Args
Introduction to Slices
Index expressions
"There only two hard things in computer science: Cache invalidation and Naming things."
The subject of this lecture is about naming things of course.
We're going to look at a lot of examples for properly naming your identifiers.
NOTE: This lecture is about using names in Go in general.
What is a Raw String Literal?
String Literals vs Raw String Literals
Code Along Examples
How to get the length of a string?
Interesting details about the len function
Calculating the length of unicode characters
Very gentle introduction to Runes and Codepoints
Introduction and usage of strings package
Getting input from the command line
And manipulating it using the strings package
String concatenation and using functions
What's iota? Why you want to use it? What it does?
Using blank-identifier in constant declarations
Creating a timezone table using iota and constants
How to print formatted output?
How Printf works
The mechanics of the Printf function
What is an escape sequence?
What is an escape character?
How to print the type of any value?
Examples for common verbs
Swiss Army Knife Verb
Argument Indexing
Type-Safety and Printf
Changing the printed precision
What's an expression switch?
What's a switch condition? How it works?
What's a case clause?
What's the difference between a switch statement and an if statement?
Until now, you were using singular values. Now it's time to learn about more advanced data types.
In this part you're going to learn almost everything about the composite types.
We're starting with the arrays, that is one of the composite types.
You're going to learn:
What's an array
How Go represents an array in computer memory
How to use arrays
You're going to learn:
What's an array
How Go represents an array in computer memory
How to use arrays
You're going to learn:
An example usecase for arrays (cont.)
Using parallel arrays for representing data
Gotchas when using the for range clause with arrays
You're going to learn:
Composite literal declaration syntax
How an array literal simplifies creating new arrays
Useful feature of trailing commas in composite literals
Ellipsis syntax when declaring arrays
Zero values of array elements
You're going to refactor the Hipster's Love Bookstore example to array literals.
Use arrays to print random moods from an array.
Learn how to use the random number generator with arrays.
You're going to learn:
How Go assign an array to another array?
Importance of comparison when assigning arrays
Code along example for the copying behavior and array assignments
You're going to learn:
How to use multi-dimensional arrays (array of arrays)?
The rules of multi-dimensional array declaration and usage
Simplified array literal element declaration syntax
Refactor a program that uses single-dimensional arrays to multi-dimensional arrays
Refactor the previous Moodly challenge to multi-dimensional arrays
You're going to learn:
Rarely known feature of Go arrays: Keyed elements
Use keyed elements to describe the index positions
Hidden details of the keyed element declaration in array literals
Cryptocurrency exchange ratios program using the keyed elements
You're going to learn:
The difference between named and unnamed types
The relation of composite types and unnamed types
Comparison and assignment rules of named and unnamed composite types
Code along usage example
You can find the links about the detailed explanations for the challenge steps and solutions.
Let's see what you're going to learn in this section.
You're going to learn the differences between slices and arrays.
You're going to learn:
The differences between slices and arrays
Comparing and Assigning Slices
Nil Slice vs Empty Slice
Using the Length of slices when comparing
Arrays, slices and the Go Standard Library
You're going to learn:
The differences between slices and arrays
A use case for a slice
Refactoring the program from arrays to slices
A very gentle introduction to the append function and the slice expressions
Arrays, slices and the Go Standard Library: sort.Ints function
You're going to learn:
The usage of the built-in append function
The return value of the append
Appending multiple elements and a slice
Simple TODO list example using appends
You're going to learn:
What is a sliceable value?
How the slice expressions (slicing) work?
What is reslicing?
You're going to learn:
How to create pagination using slice expressions?
How the sprintf function works?
You're going to learn:
How do slices work under the hood?
What's really a slice?
What's a backing array?
How Go represents the backing array in computer memory?
You'll understand what a slice value actually is:
How a slice value is stored?
What's a slice header? What does it do?
What's the pointer field of the slice header?
Does nil slice have also a slice header?
What does a slice header (or slice value) looks like in the actual Go runtime code?
When you pass a slice to a function, what gets passed actually?
How about an array? Do they work like the same when they're copied?
You will understand what the capacity of a slice means.
Why the capacity of a nil slice is zero?
What's the difference between the length and the capacity of a slice?
What's the role of the slice header's pointer field? Why is it related to the capacity?
How can you extend a slice using its capacity?
How to use the cap function?
Understand when to use parallel slice values.
What's a dummy backing array? What is their role?
Extend an empty slice using its capacity inside a loop.
You're going to learn:
The relationship between the backing array and the append function.
When does the append function create a new backing array?
The full demonstration of the append function when allocating backing arrays.
Understand when to and how can you use the full slice expression to limit the capacity of a slice.
Understand when to and how to use the make function to pre-allocate backing arrays for slices.
You will learn how to copy the slices without using a loop.
You will learn when to and how to use the copy function.
You will learn how the multi-dimensional slices work.
You will understand their differences than multi-dimensional arrays.
You will learn how to initialize inner slice elements using the make function.
You're going to learn:
How to get the names of all the empty files from a directory
This is the first part of the project, in the next lecture, you're going to use the append function to write the names of the empty files to a file.
You're going to learn:
How to write to a file using a byte slice
How to calculate file permissions using octal numbers
We're going to optimize the program using the make function.
Let's learn what the bouncing ball program is going to look like.
Learn how to draw the board using a multi-dimensional slice
Learn how to optimize the program adding a slice as a buffer
How to add a buffer and reuse it instead of doing a lot of system calls
How to simply measure the execution speed of a program
Calculate the ball position using velocity and collision detection
Complete the program by animating the ball
What is a string, really?
[]byte to string conversion
Binary and hexadecimal numbers
Build a character-set printer program so that you can intuitively understand how the Unicode code points work
Learn about the special Printf verbs to print code points
Immutable strings
Slicing and Indexing strings
Convert a string value to []byte and []rune to manipulate it
Learn how to get the runes of a string using its bytes
Learn about utf8 package's RuneCountInString and RuneCount functions
Learn about the ups and downs of using a []rune instead of []byte or string
Learn about:
How decoding works
How to manually decode a string
When to use utf8 package's DecodeRune and DecodeRuneInString functions instead of for range
Learn about:
Why strings are immutable?
Why slicing a string is an efficient operation?
What does a string value looks like behind the scenes?
Let's create a program that efficiently masks the spam links in a text by directly manipulating the bytes.
String concatenation vs using a byte buffer
Detect link patterns inside the text by manipulating the bytes
Learn about a special case for the append function for string values
Masks the links inside the text
Detect whitespaces by comparing the bytes and disable the masking when necessary
Manipulate the byte buffer directly instead of appending to it
Understand how to work with unicode strings
English to Turkish Dictionary Example
What's a map and why you might want to use one?
Map keys and comparability
Comparing map values
Slices vs Maps
How initialize a map?
How to change a map element?
How to detect whether a key exists or not? (Comma-OK idiom)
How to range over a map?
How to compare maps using Sprintf?
Learn the map internals: How they work behind the scenes?
The differences between a map and a slice value.
Properly cloning a map
Create a map using the make function
What's the importance of the size parameter?
How to delete map keys?
Learn how to remove a map completely from memory.
Go is a programming language created by Google, and this course is the most intuitive, in-depth, and highest-quality Go course on Udemy, with an insane level of attention to detail. You'll understand both the why and how. We've included thousands of animations, exercises, quizzes, examples, challenges, projects, and so on. By the end of the course, you'll become a confident Go programmer from scratch.
Why should you take this course now?
Watch ultra-detailed, entertaining, intuitive, and easy to understand illustrations and animations.
Solve 1000+ hands-on exercises (solutions are also included).
Create projects including a log parser, file scanner, spam masker, and more.
Learn Go programming tips and tricks that you can't find easily anywhere else.
Learn the Go internals and common Go idioms and best-practices.
Why should you learn Go (aka Golang and Go lang)?
Go is one of the most desired, easy to learn, and the highest paying programming languages. There are 1+ million Go programmers around the world, and the number is increasing each day exponentially. It's been used by Google, Facebook, Twitter, Uber, Docker, Kubernetes, Heroku, and many others.
Go is Efficient like C, C++, and Java, and Easy to use like Python and Javascript. It's Open-Source, Simple, Powerful, Efficient, Cross-Platform (OS X, Windows, Linux, ...), Compiled, Garbage-Collected, and Concurrent.
Go is best for Command-line Tools, Web APIs, Distributed Network Applications like Microservices, Database Engines, Big-Data Processing Pipelines, and so on.
What are you going to learn from this course (briefly)?
Go OOP: Interfaces and Methods
Internals of Methods and Interfaces
Functions and Pointers: Program design, pass by value, and addressability.
Implicit interface satisfaction
Type assertion and Type Switch
Empty interface: []interface{} vs interface{}
Value, Pointer, and Nil Receivers
Promoted Methods
Famous Interfaces
Tips about when to use interfaces
fmt.Stringer, sort.Sort, json.Marshaler, json.Unmarshaler, and so on.
Composite Types: Arrays, Slices, Maps, and Structs
Internals of Slices and Maps
Backing array, slice header, capacity, and map header
JSON encoding and decoding, field tags, embedding
Make, copy, full Slice expressions and append mechanics
UTF-8 encoding and decoding
Go Type System Mechanics
Type inference, underlying, predeclared, and unnamed types.
Untyped constants and iota.
Blank Identifier, short declaration, redeclaration, scopes, naming conventions
I/O
Process Command-Line Arguments, printf, working with files, bufio.Scanner, ...
How to create your own Go packages
How to run multiple Go files, and how to use third-party packages
Go tools
Debugging Go code, go doc, and others.
...and more.