Learn Go by project: Souin
![](https://s3.amazonaws.com/media-p.slid.es/uploads/835108/images/6947467/gopher.png)
![](https://s3.amazonaws.com/media-p.slid.es/uploads/835108/images/7745287/qedqzd.png)
Sylvain Combraque
Creator of Souin cache system
Træfik helper
Open-source contributor
@Darkweak
![](https://s3.amazonaws.com/media-p.slid.es/uploads/835108/images/5585364/1024px-Octicons-mark-github.svg.png)
@Darkweak_dev
![](https://s3.amazonaws.com/media-p.slid.es/uploads/835108/images/5593136/twitter.png)
![](https://s3.amazonaws.com/media-p.slid.es/uploads/835108/images/6947481/ZVbOcszq_400x400.jpg)
![](https://s3.amazonaws.com/media-p.slid.es/uploads/835108/images/5593231/2000px-Go_Logo_Aqua.svg.png)
Let's
Golang history
Developed by Google
Started on 2003
Opensourced on 2009
Keith Clark et Francis McCabe
Written in C
Advantages
One binary file output
Build cross-platform
Easy learning curve
Not tricky language
Multithreading
Concurrency
Written in Golang
![](https://s3.amazonaws.com/media-p.slid.es/uploads/835108/images/5593229/1300px-Docker_container_engine_logo.png)
![](https://s3.amazonaws.com/media-p.slid.es/uploads/835108/images/5593233/logo-2.png)
![](https://s3.amazonaws.com/media-p.slid.es/uploads/835108/images/7721625/istio-logo-92FF583709-seeklogo.com.png)
![](https://s3.amazonaws.com/media-p.slid.es/uploads/835108/images/7721626/coreos-1-logo-png-transparent.png)
![](https://s3.amazonaws.com/media-p.slid.es/uploads/835108/images/7721654/logo.png)
![](https://s3.amazonaws.com/media-p.slid.es/uploads/835108/images/7721658/ab915ef49812da4300dd7f1172d4acf423d918d7.png)
For the web
![](https://user-images.githubusercontent.com/1128849/36338535-05fb646a-136f-11e8-987b-e6901e717d5a.png)
![](https://raw.githubusercontent.com/jaredfolkins/badactor_logo/master/badactor_logo_300x300.png)
My history with Golang
Traefik
Emile Vauge
Written in GO
Easy to use
French Quality
![](https://s3.amazonaws.com/media-p.slid.es/uploads/835108/images/5584477/1f1eb-1f1f7.png)
Where is the cache ?
![](https://media.giphy.com/media/tvGOBZKNEX0ac/giphy.gif)
![](https://s3.amazonaws.com/media-p.slid.es/uploads/835108/images/8655112/Capture_d_écran_2021-06-08_à_23.34.11.png)
![](https://s3.amazonaws.com/media-p.slid.es/uploads/835108/images/7683691/Capture_d_écran_2020-09-01_à_01.28.55.png)
github.com/Darkweak/Souin
Golang is normalized
$GOPATH
/bin
/pkg
/src
/bin | Contains fully compiled Go softwares based on pkg objects |
/pkg | contains Go package objects compiled from src directory Go source code packages |
/src | Contains readable development sources including dependencies |
$GOROOT
Golang SDK
$GOOS
- aix
- android
- darwin
- dragonfly
- freebsd
- hurd
- illumos
- js
- linux
- netbsd
- openbsd
- plan9
- solaris
- windows
- zos
$GOARCH
- 386
- amd64
- arm
- armbe
- arm64
- arm64be
- ppc64
- ppc64le
- mips
- mipsle
- mips64
- mips64le
- mips64p32
- mips64p32le
-
ppc
- riscv
- riscv64
- s390
- s390x
- sparc
- sparc64
- wasm
Live demo
![](https://s3.amazonaws.com/media-p.slid.es/uploads/835108/images/7745287/qedqzd.png)
https://github.com/Darkweak/golang-starter
![](https://s3.amazonaws.com/media-p.slid.es/uploads/835108/images/7782646/Capture_d_écran_2020-10-01_à_16.50.23.png)
First Hello World
Typing and variables
Functions and returns
Goroutines
A goroutine is a lightweight thread of execution.
Go will run both at same time, then your main thread will continue the main script in parallel without taking care of second thread
![](https://s3.amazonaws.com/media-p.slid.es/uploads/835108/images/6947468/goroutines.jpg)
Channels
Testing
![](https://s3.amazonaws.com/media-p.slid.es/uploads/835108/images/7767724/affiche-tester-c-est-douter-2.jpg)
More explicit example ?
Usefull tools
Usefull tools
Testing
Linter
- golint
- govet
- go test
- go tool
Usefull tools
Testing
Linter
- golint
- go vet
- go test
- go tool
Usefull tools
Testing
Linter
- golint
- govet
- go test
- go tool
// Run all tests
go test -v ./...
// Run all tests and generate a cover
// reporting
go test ./... -coverprofile cover.out
// Show coverage percentage
go tool cover -func cover.out
// Lint all application
golint ./...
// Examine Go source code and
// reports suspicious constructs
go vet ./...
Usefull commands
goimports
gofmt
gobuild
go list
go run
go fix
go test
go clean
Usefull links
https://golang.org
https://gobyexample.com
http://golang-challenge.org
https://www.codewars.com
https://blog.golang.org
https://github.com/avelino/awesome-go
https://play.golang.org
Another cool side-projects
Smersh
souin-prestashop
Souin as prestashop module
Open-source pentest oriented platform to help pentester to get enhancement
github.com/CMEPW/Smersh
souin-wordpress
Souin as wordpress plugin
github.com/lucmichalski/prestashop-souin
github.com/darkweak/wordpress-souin
Thank you for your attention
![](https://media.giphy.com/media/LpiHFtzyFTqe3AaT33/giphy.gif)
Learn Golang by project
By darkweak
Learn Golang by project
- 869