notes.org
1 #+title: Welcome to a tour of Go 2 3 - *Using the tour* 4 5 Welcome to a tour of the [[https://go.dev][Go programming language]]. The tour covers the most important features of the language, mainly: 6 7 - *Basics* 8 9 The starting point, learn all the basics of the language. 10 11 Declaring variables, calling functions, and all the things you need to know before moving to the next lessons. 12 13 [[https://go.dev/tour/basics][Packages, variables, and functions.]] 14 Learn the basic components of any Go program. 15 16 #+BEGIN_SRC go 17 package main 18 19 import ( 20 "fmt" 21 "math/rand" 22 ) 23 24 func main() { 25 fmt.Println("My favorite number is", rand.Intn(10)) 26 } 27 #+END_SRC 28 29 [[https://go.dev/tour/flowcontrol][Flow control statements: for, if, else, switch and defer]] 30 Learn how to control the flow of your code with conditionals, loops, switches and defers. 31 32 [[https://go.dev/tour/moretypes][More types: structs, slices, and maps.]] 33 Learn how to define types based on existing ones: this lesson covers structs, arrays, slices, and maps. 34 35 Methods and interfaces 36 37 Learn how to define methods on types, how to declare interfaces, and how to put everything together. 38 39 [[https://go.dev/tour/methods][Methods and interfaces]] 40 This lesson covers methods and interfaces, the constructs that define objects and their behavior. 41 42 Generics 43 44 Learn how to use type parameters in Go functions and structs. 45 46 [[https://go.dev/tour/generics][Generics]] 47 Go supports generic programming using type parameters. This lesson shows some examples for employing generics in your code. 48 49 Concurrency 50 51 Go provides concurrency features as part of the core language. 52 53 This module goes over goroutines and channels, and how they are used to implement different concurrency patterns. 54 55 [[https://go.dev/tour/concurrency][Concurrency]] 56 Go provides concurrency constructions as part of the core language. This lesson presents them and gives some examples on how they can be used.