Golang Tutorial
Master Golang in a week. This is the best golang tutorial.
- Easy reading.
- Correct.
- No nonsense, no story telling.
- No elite hacker jargons.
- Every concept comes with a runnable standalone code example.
See also: Why I Love Golang
Table of Contents
Compile and Run
- Filename Extension
- Compile and Run
- Source Code Encoding
- Print Version
- Package, Import
- Comment
- Semicolon
- Format Source Code
String
- String
- What is String
- String Backslash Escape
- String Functions
- Convert Value to String
- Print String as Byte, Char, Integer
- String, Byte Slice, Rune Slice
- Regular Expression
Rune
Types and Values
Conditionals
Loop
Data Structure
Array and Slice
- Array
- Slice
- Slice of Slice
- Append to Slice
- Cut Slice (Delete Elements)
- Copy Slice
- Clear Slice
- Nested Slice
- Slice of Strings to String
- Iterate Slice
- Convert Array to Slice
- Print Slice, Array
Map
Struct
Function
- Function
- Variadic Function
- Pass Array Elements to Function
- Function Multi-Value Returns
- Nest Function
- Function as Argument
- Function Return Function
- Closure
Read Write File
- Read File
- Read First n Bytes of File
- Write to File
- Walk Directory, List Files
- Check File Exist
- Get Script Path