2. PHILIP, YOU HAVE TO CHECKOUT
GOLANG, IT IS VERY POWERFUL
FOR DOING DEVOPS!
@rnrbarbosa Roberto Barbosa, December 2018
3. - Unixer (IBM AIX)
- Linuxer (RHEL, Debian,
SLES)
- SysAdmin, Middleware
Engineer @swisspost
- MAS in Software
Development
- Containers (Dotcloud,
Tutum, Kubernetes)
- Cloudbee (AWS,
Digitalocean)
- Python and Django in
Sparetime
- Most productive on Mac
OSX
- Learning Golang
WHO AM I
PHILIP SAHLI
4. WHY THEY
CREATED GO
Rob Pike Bell Labs, Unix, UTF-8
Ken Thompson Bell Labs, B, UTF-8
Robert Griesemer C++
Go was born out of frustration with existing languages and
environments for the work we were doing at Google.
Programming had become too difficult and the choice of
languages was partly to blame. One had to choose either efficient
compilation, efficient execution, or ease of programming; all
three were not available in the same mainstream language.
Source: https://golang.org/doc/faq#creating_a_new_language
5. GO IS YOUNG
2007 - 2009
2012 Version 1.0
Work on first release
go1.11 (released 2018/08/24)
go1.10 (released 2018/02/16)
go1.9 (released 2017/08/24)
go1.8 (released 2017/02/16)
go1.7 (released 2016/08/15)
go1.6 (released 2016/02/17)
go1.5 (released 2015/08/19)
go1.4 (released 2014/12/10)
go1.3 (released 2014/06/18)
go1.2 (released 2013/12/01)
go1.1 (released 2013/05/13)
go1 (released 2012/03/28)
6. WHAT IS GO
- Statically typed
- Compiled to native machine code
10. WHY TO USE GO
Open Source
One binary
Dependencies
Fast compilation
Readability
Standard Libraries
Concurrency
Command-line Tools
IDE
SIMPLE, RELIABLE AND EFFICIENT
11. METHODS
Go does not have classes. However, you can define methods on types.
A method is a function with a special receiver argument.
type Vertex struct {
X, Y float64
}
func (v Vertex) Abs() float64 {
return math.Sqrt(v.X*v.X + v.Y*v.Y)
}
12. POINTERSpackage main
import "fmt"
func main() {
i, j := 42, 2701
p := &i // point to i
fmt.Println(*p) // read i through the pointer
*p = 21 // set i through the pointer
fmt.Println(i) // see the new value of i
p = &j // point to j
*p = *p / 37 // divide j through the pointer
fmt.Println(j) // see the new value of j
}
Go has pointers. A pointer holds the memory address of a value.