SlideShare a Scribd company logo
A Tour of Go
Workshop @ Golang Brno meetup #4
24 January 2017
Rodolfo Carvalho
Red Hat
A Tour of Go workshop
Objectives:
Fun & enjoyment
First contact with Go
Close gaps
Introduction to automated testing
Networking
Note: the name of the language is Go, the website is golang.org
Introduction
Let's get to know each other:
Name
Occupation
Programming experience (including or not Go)
Agenda
A Tour of Go
The go tool
The testing package
Coding Dojo
Retrospective
Rules
Ask questions
Bring questions to the group
Play with examples (run, modify, run, ...)
And...
Work in pairs
Pair with someone you met for the rst time
Alternate who controls the keyboard
A Tour of Go
Online
tour.golang.org
O ine
go tool tour
Keyboard shortcuts
PageUp / PageDown : previous / next
Ctrl+Enter : format
Shift+Enter : run
Skip the exercises, we'll go back to them later
We will pause after the "Basics"
The go tool
a tool for managing Go source code
$ go
...
The commands are:
build compile packages and dependencies
doc show documentation for package or symbol
fmt run gofmt on package sources
run compile and run Go program
test test packages
...
go test
automates testing packages
recompiles each package along with any les with names matching the pattern
"*_test.go"
go test with no arguments compiles and tests the package with source in the current
directory
The testing package
$ go doc testing
... provides support for automated testing of Go packages. (...) used in
concert with the ``go test'' command, which automates execution of any
function of the form
func TestXxx(*testing.T)
...
Some methods of testing.T
$ go doc testing.T
func (c *T) Fail()
func (c *T) FailNow()
func (c *T) Log(args ...interface{})
func (c *T) Logf(format string, args ...interface{})
func (c *T) Error(args ...interface{})
func (c *T) Errorf(format string, args ...interface{})
func (c *T) Fatal(args ...interface{})
func (c *T) Fatalf(format string, args ...interface{})
A minimal test le template
foo_test.go
package foo
import "testing"
func TestFoo(t *testing.T) {
got := Foo()
want := "bar"
if got != want {
t.Errorf("Foo() = %v, want %v", got, want)
}
}
Table testing
github.com/golang/go/wiki/TableDrivenTests
func TestSame(t *testing.T) {
tests := []struct {
trees [2]*tree.Tree
want bool
}{
{
trees: [2]*tree.Tree{tree.New(1), tree.New(1)},
want: true,
},
{
trees: [2]*tree.Tree{tree.New(1), tree.New(2)},
want: false,
},
}
for _, tt := range tests {
if got := Same(tt.trees[0], tt.trees[1]); got != tt.want {
t.Errorf("Same(%v, %v) = %v, want %v", tt.trees[0], tt.trees[1], got, tt.want)
}
}
} Run
Coding Dojo
Change pairs
Work on exercises using TDD
Discuss di erent implementations with your partner
TDD rules:
Write a complete test case
See it FAIL
Make it PASS
Refactor
Exercises
Basics:
Loops and Functions: Sqrt
Slices: Pic
Maps: WordCount
Fibonacci closure
What if I don't have Go installed?
You can code online using The Go Playground. Running tests there can be
accomplished with a little trick, as in this example:
play.golang.org/p/UhY6SqAdCu
In the future, it may become easier to run tests in the playground:
github.com/golang/go/issues/6511
Exercises
Methods and interfaces:
Stringers: IPAddr
Errors: Sqrt
Readers: in nite stream of 'A'
rot13Reader
Images
Exercises
Concurrency:
Equivalent Binary Trees
Web Crawler
Coding Dojo Brno
If you want to practice more TDD, we have weekly meetings:
facebook.com/CodingDojoBrno
Retrospective
Code retreat style...
What, if anything, did you learn today?
What, if anything, surprised you today?
What, if anything, would you like to do with Go in the future?
Thank you
Rodolfo Carvalho
Red Hat
rhcarvalho@gmail.com
http://rodolfocarvalho.net
https://dojo-brno.github.io

More Related Content

What's hot

Go language presentation
Go language presentationGo language presentation
Go language presentation
paramisoft
 
A Recovering Java Developer Learns to Go
A Recovering Java Developer Learns to GoA Recovering Java Developer Learns to Go
A Recovering Java Developer Learns to Go
Matt Stine
 
Low latency Logging (BrightonPHP - 18th Nov 2013)
Low latency Logging (BrightonPHP - 18th Nov 2013)Low latency Logging (BrightonPHP - 18th Nov 2013)
Low latency Logging (BrightonPHP - 18th Nov 2013)
James Titcumb
 
Learning Python from Data
Learning Python from DataLearning Python from Data
Learning Python from Data
Mosky Liu
 
Decision making - for loop , nested loop ,if-else statements , switch in goph...
Decision making - for loop , nested loop ,if-else statements , switch in goph...Decision making - for loop , nested loop ,if-else statements , switch in goph...
Decision making - for loop , nested loop ,if-else statements , switch in goph...
sangam biradar
 
Static Analysis in Go
Static Analysis in GoStatic Analysis in Go
Static Analysis in Go
Takuya Ueda
 
Not Your Fathers C - C Application Development In 2016
Not Your Fathers C - C Application Development In 2016Not Your Fathers C - C Application Development In 2016
Not Your Fathers C - C Application Development In 2016
maiktoepfer
 
Dive into Pinkoi 2013
Dive into Pinkoi 2013Dive into Pinkoi 2013
Dive into Pinkoi 2013
Mosky Liu
 
Go for Rubyists
Go for RubyistsGo for Rubyists
Go for Rubyists
Luka Zakrajšek
 
Python debugging techniques
Python debugging techniquesPython debugging techniques
Python debugging techniques
Tuomas Suutari
 
Vocabulary Types in C++17
Vocabulary Types in C++17Vocabulary Types in C++17
Vocabulary Types in C++17
Bartlomiej Filipek
 
Writing Fast Code (JP) - PyCon JP 2015
Writing Fast Code (JP) - PyCon JP 2015Writing Fast Code (JP) - PyCon JP 2015
Writing Fast Code (JP) - PyCon JP 2015
Younggun Kim
 
EuroPython 2016 - Do I Need To Switch To Golang
EuroPython 2016 - Do I Need To Switch To GolangEuroPython 2016 - Do I Need To Switch To Golang
EuroPython 2016 - Do I Need To Switch To Golang
Max Tepkeev
 
Lisp in a Startup: the Good, the Bad, and the Ugly
Lisp in a Startup: the Good, the Bad, and the UglyLisp in a Startup: the Good, the Bad, and the Ugly
Lisp in a Startup: the Good, the Bad, and the Ugly
Vsevolod Dyomkin
 
Static and Dynamic Analysis at Ning
Static and Dynamic Analysis at NingStatic and Dynamic Analysis at Ning
Static and Dynamic Analysis at Ning
ZendCon
 
Practicing Python 3
Practicing Python 3Practicing Python 3
Practicing Python 3
Mosky Liu
 
GO programming language
GO programming languageGO programming language
GO programming language
tung vu
 
Golangにおける端末制御 リッチなターミナルUIの実現方法
Golangにおける端末制御 リッチなターミナルUIの実現方法Golangにおける端末制御 リッチなターミナルUIの実現方法
Golangにおける端末制御 リッチなターミナルUIの実現方法
Masashi Shibata
 
The GNOME way - What can we learn from and within the Open Documentation World
The GNOME way - What can we learn from and within the Open Documentation WorldThe GNOME way - What can we learn from and within the Open Documentation World
The GNOME way - What can we learn from and within the Open Documentation World
Radina Matic
 

What's hot (20)

Go language presentation
Go language presentationGo language presentation
Go language presentation
 
A Recovering Java Developer Learns to Go
A Recovering Java Developer Learns to GoA Recovering Java Developer Learns to Go
A Recovering Java Developer Learns to Go
 
Low latency Logging (BrightonPHP - 18th Nov 2013)
Low latency Logging (BrightonPHP - 18th Nov 2013)Low latency Logging (BrightonPHP - 18th Nov 2013)
Low latency Logging (BrightonPHP - 18th Nov 2013)
 
Learning Python from Data
Learning Python from DataLearning Python from Data
Learning Python from Data
 
Decision making - for loop , nested loop ,if-else statements , switch in goph...
Decision making - for loop , nested loop ,if-else statements , switch in goph...Decision making - for loop , nested loop ,if-else statements , switch in goph...
Decision making - for loop , nested loop ,if-else statements , switch in goph...
 
Static Analysis in Go
Static Analysis in GoStatic Analysis in Go
Static Analysis in Go
 
Not Your Fathers C - C Application Development In 2016
Not Your Fathers C - C Application Development In 2016Not Your Fathers C - C Application Development In 2016
Not Your Fathers C - C Application Development In 2016
 
Dive into Pinkoi 2013
Dive into Pinkoi 2013Dive into Pinkoi 2013
Dive into Pinkoi 2013
 
FTD JVM Internals
FTD JVM InternalsFTD JVM Internals
FTD JVM Internals
 
Go for Rubyists
Go for RubyistsGo for Rubyists
Go for Rubyists
 
Python debugging techniques
Python debugging techniquesPython debugging techniques
Python debugging techniques
 
Vocabulary Types in C++17
Vocabulary Types in C++17Vocabulary Types in C++17
Vocabulary Types in C++17
 
Writing Fast Code (JP) - PyCon JP 2015
Writing Fast Code (JP) - PyCon JP 2015Writing Fast Code (JP) - PyCon JP 2015
Writing Fast Code (JP) - PyCon JP 2015
 
EuroPython 2016 - Do I Need To Switch To Golang
EuroPython 2016 - Do I Need To Switch To GolangEuroPython 2016 - Do I Need To Switch To Golang
EuroPython 2016 - Do I Need To Switch To Golang
 
Lisp in a Startup: the Good, the Bad, and the Ugly
Lisp in a Startup: the Good, the Bad, and the UglyLisp in a Startup: the Good, the Bad, and the Ugly
Lisp in a Startup: the Good, the Bad, and the Ugly
 
Static and Dynamic Analysis at Ning
Static and Dynamic Analysis at NingStatic and Dynamic Analysis at Ning
Static and Dynamic Analysis at Ning
 
Practicing Python 3
Practicing Python 3Practicing Python 3
Practicing Python 3
 
GO programming language
GO programming languageGO programming language
GO programming language
 
Golangにおける端末制御 リッチなターミナルUIの実現方法
Golangにおける端末制御 リッチなターミナルUIの実現方法Golangにおける端末制御 リッチなターミナルUIの実現方法
Golangにおける端末制御 リッチなターミナルUIの実現方法
 
The GNOME way - What can we learn from and within the Open Documentation World
The GNOME way - What can we learn from and within the Open Documentation WorldThe GNOME way - What can we learn from and within the Open Documentation World
The GNOME way - What can we learn from and within the Open Documentation World
 

Similar to A Tour of Go - Workshop

Golang basics for Java developers - Part 1
Golang basics for Java developers - Part 1Golang basics for Java developers - Part 1
Golang basics for Java developers - Part 1
Robert Stern
 
The GO Language : From Beginners to Gophers
The GO Language : From Beginners to GophersThe GO Language : From Beginners to Gophers
The GO Language : From Beginners to Gophers
Alessandro Sanino
 
The Kotlin Programming Language
The Kotlin Programming LanguageThe Kotlin Programming Language
The Kotlin Programming Languageintelliyole
 
Go 1.10 Release Party - PDX Go
Go 1.10 Release Party - PDX GoGo 1.10 Release Party - PDX Go
Go 1.10 Release Party - PDX Go
Rodolfo Carvalho
 
Golang iran - tutorial go programming language - Preliminary
Golang iran - tutorial  go programming language - PreliminaryGolang iran - tutorial  go programming language - Preliminary
Golang iran - tutorial go programming language - Preliminary
go-lang
 
Introduction to go language programming
Introduction to go language programmingIntroduction to go language programming
Introduction to go language programming
Mahmoud Masih Tehrani
 
2007 09 10 Fzi Training Groovy Grails V Ws
2007 09 10 Fzi Training Groovy Grails V Ws2007 09 10 Fzi Training Groovy Grails V Ws
2007 09 10 Fzi Training Groovy Grails V Ws
loffenauer
 
Coding in GO - GDG SL - NSBM
Coding in GO - GDG SL - NSBMCoding in GO - GDG SL - NSBM
Coding in GO - GDG SL - NSBM
Raveen Perera
 
Go serving: Building server app with go
Go serving: Building server app with goGo serving: Building server app with go
Go serving: Building server app with go
Hean Hong Leong
 
Groovy for java developers
Groovy for java developersGroovy for java developers
Groovy for java developers
Puneet Behl
 
Introduction to clojure
Introduction to clojureIntroduction to clojure
Introduction to clojure
Abbas Raza
 
Go programming introduction
Go programming introductionGo programming introduction
Go programming introduction
Ginto Joseph
 
Golang dot-testing-lite
Golang dot-testing-liteGolang dot-testing-lite
Golang dot-testing-lite
Richárd Kovács
 
Go Lang Tutorial
Go Lang TutorialGo Lang Tutorial
Go Lang Tutorial
Wei-Ning Huang
 
Golang
GolangGolang
Golang
Felipe Mamud
 
Golang勉強会
Golang勉強会Golang勉強会
Golang勉強会
Shin Sekaryo
 
Summary of C++17 features
Summary of C++17 featuresSummary of C++17 features
Summary of C++17 features
Bartlomiej Filipek
 
Go. Why it goes
Go. Why it goesGo. Why it goes
Go. Why it goes
Sergey Pichkurov
 
Golang workshop
Golang workshopGolang workshop
Golang workshop
Victor S. Recio
 
Groovy Introduction - JAX Germany - 2008
Groovy Introduction - JAX Germany - 2008Groovy Introduction - JAX Germany - 2008
Groovy Introduction - JAX Germany - 2008
Guillaume Laforge
 

Similar to A Tour of Go - Workshop (20)

Golang basics for Java developers - Part 1
Golang basics for Java developers - Part 1Golang basics for Java developers - Part 1
Golang basics for Java developers - Part 1
 
The GO Language : From Beginners to Gophers
The GO Language : From Beginners to GophersThe GO Language : From Beginners to Gophers
The GO Language : From Beginners to Gophers
 
The Kotlin Programming Language
The Kotlin Programming LanguageThe Kotlin Programming Language
The Kotlin Programming Language
 
Go 1.10 Release Party - PDX Go
Go 1.10 Release Party - PDX GoGo 1.10 Release Party - PDX Go
Go 1.10 Release Party - PDX Go
 
Golang iran - tutorial go programming language - Preliminary
Golang iran - tutorial  go programming language - PreliminaryGolang iran - tutorial  go programming language - Preliminary
Golang iran - tutorial go programming language - Preliminary
 
Introduction to go language programming
Introduction to go language programmingIntroduction to go language programming
Introduction to go language programming
 
2007 09 10 Fzi Training Groovy Grails V Ws
2007 09 10 Fzi Training Groovy Grails V Ws2007 09 10 Fzi Training Groovy Grails V Ws
2007 09 10 Fzi Training Groovy Grails V Ws
 
Coding in GO - GDG SL - NSBM
Coding in GO - GDG SL - NSBMCoding in GO - GDG SL - NSBM
Coding in GO - GDG SL - NSBM
 
Go serving: Building server app with go
Go serving: Building server app with goGo serving: Building server app with go
Go serving: Building server app with go
 
Groovy for java developers
Groovy for java developersGroovy for java developers
Groovy for java developers
 
Introduction to clojure
Introduction to clojureIntroduction to clojure
Introduction to clojure
 
Go programming introduction
Go programming introductionGo programming introduction
Go programming introduction
 
Golang dot-testing-lite
Golang dot-testing-liteGolang dot-testing-lite
Golang dot-testing-lite
 
Go Lang Tutorial
Go Lang TutorialGo Lang Tutorial
Go Lang Tutorial
 
Golang
GolangGolang
Golang
 
Golang勉強会
Golang勉強会Golang勉強会
Golang勉強会
 
Summary of C++17 features
Summary of C++17 featuresSummary of C++17 features
Summary of C++17 features
 
Go. Why it goes
Go. Why it goesGo. Why it goes
Go. Why it goes
 
Golang workshop
Golang workshopGolang workshop
Golang workshop
 
Groovy Introduction - JAX Germany - 2008
Groovy Introduction - JAX Germany - 2008Groovy Introduction - JAX Germany - 2008
Groovy Introduction - JAX Germany - 2008
 

More from Rodolfo Carvalho

OpenShift Overview - Red Hat Open School 2017
OpenShift Overview - Red Hat Open School 2017OpenShift Overview - Red Hat Open School 2017
OpenShift Overview - Red Hat Open School 2017
Rodolfo Carvalho
 
OpenShift Overview - Red Hat Open House 2017
OpenShift Overview - Red Hat Open House 2017OpenShift Overview - Red Hat Open House 2017
OpenShift Overview - Red Hat Open House 2017
Rodolfo Carvalho
 
Automation with Ansible and Containers
Automation with Ansible and ContainersAutomation with Ansible and Containers
Automation with Ansible and Containers
Rodolfo Carvalho
 
Go 1.8 Release Party
Go 1.8 Release PartyGo 1.8 Release Party
Go 1.8 Release Party
Rodolfo Carvalho
 
Building and Deploying containerized Python Apps in the Cloud
Building and Deploying containerized Python Apps in the CloudBuilding and Deploying containerized Python Apps in the Cloud
Building and Deploying containerized Python Apps in the Cloud
Rodolfo Carvalho
 
Python deployments on OpenShift 3
Python deployments on OpenShift 3Python deployments on OpenShift 3
Python deployments on OpenShift 3
Rodolfo Carvalho
 
Composing WSGI apps and spellchecking it all
Composing WSGI apps and spellchecking it allComposing WSGI apps and spellchecking it all
Composing WSGI apps and spellchecking it all
Rodolfo Carvalho
 
Pykonik Coding Dojo
Pykonik Coding DojoPykonik Coding Dojo
Pykonik Coding Dojo
Rodolfo Carvalho
 
Concurrency in Python4k
Concurrency in Python4kConcurrency in Python4k
Concurrency in Python4k
Rodolfo Carvalho
 
Coding Kwoon
Coding KwoonCoding Kwoon
Coding Kwoon
Rodolfo Carvalho
 
Python in 15 minutes
Python in 15 minutesPython in 15 minutes
Python in 15 minutes
Rodolfo Carvalho
 
O CPAN tem as ferramentas que você precisa para fazer TDD em Perl, o Coding D...
O CPAN tem as ferramentas que você precisa para fazer TDD em Perl, o Coding D...O CPAN tem as ferramentas que você precisa para fazer TDD em Perl, o Coding D...
O CPAN tem as ferramentas que você precisa para fazer TDD em Perl, o Coding D...
Rodolfo Carvalho
 
Redes livres de escala
Redes livres de escalaRedes livres de escala
Redes livres de escala
Rodolfo Carvalho
 
Redes livres de escala
Redes livres de escalaRedes livres de escala
Redes livres de escala
Rodolfo Carvalho
 
XMPP
XMPPXMPP
Content Delivery Networks
Content Delivery NetworksContent Delivery Networks
Content Delivery Networks
Rodolfo Carvalho
 
TDD do seu jeito
TDD do seu jeitoTDD do seu jeito
TDD do seu jeito
Rodolfo Carvalho
 
Intro Dojo Rio Python Campus
Intro Dojo Rio Python CampusIntro Dojo Rio Python Campus
Intro Dojo Rio Python Campus
Rodolfo Carvalho
 
Intro Dojo Rio
Intro Dojo RioIntro Dojo Rio
Intro Dojo Rio
Rodolfo Carvalho
 
Pyndorama
PyndoramaPyndorama
Pyndorama
Rodolfo Carvalho
 

More from Rodolfo Carvalho (20)

OpenShift Overview - Red Hat Open School 2017
OpenShift Overview - Red Hat Open School 2017OpenShift Overview - Red Hat Open School 2017
OpenShift Overview - Red Hat Open School 2017
 
OpenShift Overview - Red Hat Open House 2017
OpenShift Overview - Red Hat Open House 2017OpenShift Overview - Red Hat Open House 2017
OpenShift Overview - Red Hat Open House 2017
 
Automation with Ansible and Containers
Automation with Ansible and ContainersAutomation with Ansible and Containers
Automation with Ansible and Containers
 
Go 1.8 Release Party
Go 1.8 Release PartyGo 1.8 Release Party
Go 1.8 Release Party
 
Building and Deploying containerized Python Apps in the Cloud
Building and Deploying containerized Python Apps in the CloudBuilding and Deploying containerized Python Apps in the Cloud
Building and Deploying containerized Python Apps in the Cloud
 
Python deployments on OpenShift 3
Python deployments on OpenShift 3Python deployments on OpenShift 3
Python deployments on OpenShift 3
 
Composing WSGI apps and spellchecking it all
Composing WSGI apps and spellchecking it allComposing WSGI apps and spellchecking it all
Composing WSGI apps and spellchecking it all
 
Pykonik Coding Dojo
Pykonik Coding DojoPykonik Coding Dojo
Pykonik Coding Dojo
 
Concurrency in Python4k
Concurrency in Python4kConcurrency in Python4k
Concurrency in Python4k
 
Coding Kwoon
Coding KwoonCoding Kwoon
Coding Kwoon
 
Python in 15 minutes
Python in 15 minutesPython in 15 minutes
Python in 15 minutes
 
O CPAN tem as ferramentas que você precisa para fazer TDD em Perl, o Coding D...
O CPAN tem as ferramentas que você precisa para fazer TDD em Perl, o Coding D...O CPAN tem as ferramentas que você precisa para fazer TDD em Perl, o Coding D...
O CPAN tem as ferramentas que você precisa para fazer TDD em Perl, o Coding D...
 
Redes livres de escala
Redes livres de escalaRedes livres de escala
Redes livres de escala
 
Redes livres de escala
Redes livres de escalaRedes livres de escala
Redes livres de escala
 
XMPP
XMPPXMPP
XMPP
 
Content Delivery Networks
Content Delivery NetworksContent Delivery Networks
Content Delivery Networks
 
TDD do seu jeito
TDD do seu jeitoTDD do seu jeito
TDD do seu jeito
 
Intro Dojo Rio Python Campus
Intro Dojo Rio Python CampusIntro Dojo Rio Python Campus
Intro Dojo Rio Python Campus
 
Intro Dojo Rio
Intro Dojo RioIntro Dojo Rio
Intro Dojo Rio
 
Pyndorama
PyndoramaPyndorama
Pyndorama
 

Recently uploaded

Pushing the limits of ePRTC: 100ns holdover for 100 days
Pushing the limits of ePRTC: 100ns holdover for 100 daysPushing the limits of ePRTC: 100ns holdover for 100 days
Pushing the limits of ePRTC: 100ns holdover for 100 days
Adtran
 
Data structures and Algorithms in Python.pdf
Data structures and Algorithms in Python.pdfData structures and Algorithms in Python.pdf
Data structures and Algorithms in Python.pdf
TIPNGVN2
 
GraphSummit Singapore | The Art of the Possible with Graph - Q2 2024
GraphSummit Singapore | The Art of the  Possible with Graph - Q2 2024GraphSummit Singapore | The Art of the  Possible with Graph - Q2 2024
GraphSummit Singapore | The Art of the Possible with Graph - Q2 2024
Neo4j
 
GraphSummit Singapore | Graphing Success: Revolutionising Organisational Stru...
GraphSummit Singapore | Graphing Success: Revolutionising Organisational Stru...GraphSummit Singapore | Graphing Success: Revolutionising Organisational Stru...
GraphSummit Singapore | Graphing Success: Revolutionising Organisational Stru...
Neo4j
 
Unlock the Future of Search with MongoDB Atlas_ Vector Search Unleashed.pdf
Unlock the Future of Search with MongoDB Atlas_ Vector Search Unleashed.pdfUnlock the Future of Search with MongoDB Atlas_ Vector Search Unleashed.pdf
Unlock the Future of Search with MongoDB Atlas_ Vector Search Unleashed.pdf
Malak Abu Hammad
 
PCI PIN Basics Webinar from the Controlcase Team
PCI PIN Basics Webinar from the Controlcase TeamPCI PIN Basics Webinar from the Controlcase Team
PCI PIN Basics Webinar from the Controlcase Team
ControlCase
 
Epistemic Interaction - tuning interfaces to provide information for AI support
Epistemic Interaction - tuning interfaces to provide information for AI supportEpistemic Interaction - tuning interfaces to provide information for AI support
Epistemic Interaction - tuning interfaces to provide information for AI support
Alan Dix
 
“I’m still / I’m still / Chaining from the Block”
“I’m still / I’m still / Chaining from the Block”“I’m still / I’m still / Chaining from the Block”
“I’m still / I’m still / Chaining from the Block”
Claudio Di Ciccio
 
20240609 QFM020 Irresponsible AI Reading List May 2024
20240609 QFM020 Irresponsible AI Reading List May 202420240609 QFM020 Irresponsible AI Reading List May 2024
20240609 QFM020 Irresponsible AI Reading List May 2024
Matthew Sinclair
 
Artificial Intelligence for XMLDevelopment
Artificial Intelligence for XMLDevelopmentArtificial Intelligence for XMLDevelopment
Artificial Intelligence for XMLDevelopment
Octavian Nadolu
 
Mind map of terminologies used in context of Generative AI
Mind map of terminologies used in context of Generative AIMind map of terminologies used in context of Generative AI
Mind map of terminologies used in context of Generative AI
Kumud Singh
 
Essentials of Automations: The Art of Triggers and Actions in FME
Essentials of Automations: The Art of Triggers and Actions in FMEEssentials of Automations: The Art of Triggers and Actions in FME
Essentials of Automations: The Art of Triggers and Actions in FME
Safe Software
 
zkStudyClub - Reef: Fast Succinct Non-Interactive Zero-Knowledge Regex Proofs
zkStudyClub - Reef: Fast Succinct Non-Interactive Zero-Knowledge Regex ProofszkStudyClub - Reef: Fast Succinct Non-Interactive Zero-Knowledge Regex Proofs
zkStudyClub - Reef: Fast Succinct Non-Interactive Zero-Knowledge Regex Proofs
Alex Pruden
 
How to Get CNIC Information System with Paksim Ga.pptx
How to Get CNIC Information System with Paksim Ga.pptxHow to Get CNIC Information System with Paksim Ga.pptx
How to Get CNIC Information System with Paksim Ga.pptx
danishmna97
 
GraphSummit Singapore | Enhancing Changi Airport Group's Passenger Experience...
GraphSummit Singapore | Enhancing Changi Airport Group's Passenger Experience...GraphSummit Singapore | Enhancing Changi Airport Group's Passenger Experience...
GraphSummit Singapore | Enhancing Changi Airport Group's Passenger Experience...
Neo4j
 
By Design, not by Accident - Agile Venture Bolzano 2024
By Design, not by Accident - Agile Venture Bolzano 2024By Design, not by Accident - Agile Venture Bolzano 2024
By Design, not by Accident - Agile Venture Bolzano 2024
Pierluigi Pugliese
 
みなさんこんにちはこれ何文字まで入るの?40文字以下不可とか本当に意味わからないけどこれ限界文字数書いてないからマジでやばい文字数いけるんじゃないの?えこ...
みなさんこんにちはこれ何文字まで入るの?40文字以下不可とか本当に意味わからないけどこれ限界文字数書いてないからマジでやばい文字数いけるんじゃないの?えこ...みなさんこんにちはこれ何文字まで入るの?40文字以下不可とか本当に意味わからないけどこれ限界文字数書いてないからマジでやばい文字数いけるんじゃないの?えこ...
みなさんこんにちはこれ何文字まで入るの?40文字以下不可とか本当に意味わからないけどこれ限界文字数書いてないからマジでやばい文字数いけるんじゃないの?えこ...
名前 です男
 
Why You Should Replace Windows 11 with Nitrux Linux 3.5.0 for enhanced perfor...
Why You Should Replace Windows 11 with Nitrux Linux 3.5.0 for enhanced perfor...Why You Should Replace Windows 11 with Nitrux Linux 3.5.0 for enhanced perfor...
Why You Should Replace Windows 11 with Nitrux Linux 3.5.0 for enhanced perfor...
SOFTTECHHUB
 
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
DanBrown980551
 
Alt. GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using ...
Alt. GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using ...Alt. GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using ...
Alt. GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using ...
James Anderson
 

Recently uploaded (20)

Pushing the limits of ePRTC: 100ns holdover for 100 days
Pushing the limits of ePRTC: 100ns holdover for 100 daysPushing the limits of ePRTC: 100ns holdover for 100 days
Pushing the limits of ePRTC: 100ns holdover for 100 days
 
Data structures and Algorithms in Python.pdf
Data structures and Algorithms in Python.pdfData structures and Algorithms in Python.pdf
Data structures and Algorithms in Python.pdf
 
GraphSummit Singapore | The Art of the Possible with Graph - Q2 2024
GraphSummit Singapore | The Art of the  Possible with Graph - Q2 2024GraphSummit Singapore | The Art of the  Possible with Graph - Q2 2024
GraphSummit Singapore | The Art of the Possible with Graph - Q2 2024
 
GraphSummit Singapore | Graphing Success: Revolutionising Organisational Stru...
GraphSummit Singapore | Graphing Success: Revolutionising Organisational Stru...GraphSummit Singapore | Graphing Success: Revolutionising Organisational Stru...
GraphSummit Singapore | Graphing Success: Revolutionising Organisational Stru...
 
Unlock the Future of Search with MongoDB Atlas_ Vector Search Unleashed.pdf
Unlock the Future of Search with MongoDB Atlas_ Vector Search Unleashed.pdfUnlock the Future of Search with MongoDB Atlas_ Vector Search Unleashed.pdf
Unlock the Future of Search with MongoDB Atlas_ Vector Search Unleashed.pdf
 
PCI PIN Basics Webinar from the Controlcase Team
PCI PIN Basics Webinar from the Controlcase TeamPCI PIN Basics Webinar from the Controlcase Team
PCI PIN Basics Webinar from the Controlcase Team
 
Epistemic Interaction - tuning interfaces to provide information for AI support
Epistemic Interaction - tuning interfaces to provide information for AI supportEpistemic Interaction - tuning interfaces to provide information for AI support
Epistemic Interaction - tuning interfaces to provide information for AI support
 
“I’m still / I’m still / Chaining from the Block”
“I’m still / I’m still / Chaining from the Block”“I’m still / I’m still / Chaining from the Block”
“I’m still / I’m still / Chaining from the Block”
 
20240609 QFM020 Irresponsible AI Reading List May 2024
20240609 QFM020 Irresponsible AI Reading List May 202420240609 QFM020 Irresponsible AI Reading List May 2024
20240609 QFM020 Irresponsible AI Reading List May 2024
 
Artificial Intelligence for XMLDevelopment
Artificial Intelligence for XMLDevelopmentArtificial Intelligence for XMLDevelopment
Artificial Intelligence for XMLDevelopment
 
Mind map of terminologies used in context of Generative AI
Mind map of terminologies used in context of Generative AIMind map of terminologies used in context of Generative AI
Mind map of terminologies used in context of Generative AI
 
Essentials of Automations: The Art of Triggers and Actions in FME
Essentials of Automations: The Art of Triggers and Actions in FMEEssentials of Automations: The Art of Triggers and Actions in FME
Essentials of Automations: The Art of Triggers and Actions in FME
 
zkStudyClub - Reef: Fast Succinct Non-Interactive Zero-Knowledge Regex Proofs
zkStudyClub - Reef: Fast Succinct Non-Interactive Zero-Knowledge Regex ProofszkStudyClub - Reef: Fast Succinct Non-Interactive Zero-Knowledge Regex Proofs
zkStudyClub - Reef: Fast Succinct Non-Interactive Zero-Knowledge Regex Proofs
 
How to Get CNIC Information System with Paksim Ga.pptx
How to Get CNIC Information System with Paksim Ga.pptxHow to Get CNIC Information System with Paksim Ga.pptx
How to Get CNIC Information System with Paksim Ga.pptx
 
GraphSummit Singapore | Enhancing Changi Airport Group's Passenger Experience...
GraphSummit Singapore | Enhancing Changi Airport Group's Passenger Experience...GraphSummit Singapore | Enhancing Changi Airport Group's Passenger Experience...
GraphSummit Singapore | Enhancing Changi Airport Group's Passenger Experience...
 
By Design, not by Accident - Agile Venture Bolzano 2024
By Design, not by Accident - Agile Venture Bolzano 2024By Design, not by Accident - Agile Venture Bolzano 2024
By Design, not by Accident - Agile Venture Bolzano 2024
 
みなさんこんにちはこれ何文字まで入るの?40文字以下不可とか本当に意味わからないけどこれ限界文字数書いてないからマジでやばい文字数いけるんじゃないの?えこ...
みなさんこんにちはこれ何文字まで入るの?40文字以下不可とか本当に意味わからないけどこれ限界文字数書いてないからマジでやばい文字数いけるんじゃないの?えこ...みなさんこんにちはこれ何文字まで入るの?40文字以下不可とか本当に意味わからないけどこれ限界文字数書いてないからマジでやばい文字数いけるんじゃないの?えこ...
みなさんこんにちはこれ何文字まで入るの?40文字以下不可とか本当に意味わからないけどこれ限界文字数書いてないからマジでやばい文字数いけるんじゃないの?えこ...
 
Why You Should Replace Windows 11 with Nitrux Linux 3.5.0 for enhanced perfor...
Why You Should Replace Windows 11 with Nitrux Linux 3.5.0 for enhanced perfor...Why You Should Replace Windows 11 with Nitrux Linux 3.5.0 for enhanced perfor...
Why You Should Replace Windows 11 with Nitrux Linux 3.5.0 for enhanced perfor...
 
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
 
Alt. GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using ...
Alt. GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using ...Alt. GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using ...
Alt. GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using ...
 

A Tour of Go - Workshop

  • 1. A Tour of Go Workshop @ Golang Brno meetup #4 24 January 2017 Rodolfo Carvalho Red Hat
  • 2. A Tour of Go workshop Objectives: Fun & enjoyment First contact with Go Close gaps Introduction to automated testing Networking Note: the name of the language is Go, the website is golang.org
  • 3. Introduction Let's get to know each other: Name Occupation Programming experience (including or not Go)
  • 4. Agenda A Tour of Go The go tool The testing package Coding Dojo Retrospective
  • 5. Rules Ask questions Bring questions to the group Play with examples (run, modify, run, ...) And... Work in pairs Pair with someone you met for the rst time Alternate who controls the keyboard
  • 6. A Tour of Go Online tour.golang.org O ine go tool tour Keyboard shortcuts PageUp / PageDown : previous / next Ctrl+Enter : format Shift+Enter : run Skip the exercises, we'll go back to them later We will pause after the "Basics"
  • 7. The go tool a tool for managing Go source code $ go ... The commands are: build compile packages and dependencies doc show documentation for package or symbol fmt run gofmt on package sources run compile and run Go program test test packages ...
  • 8. go test automates testing packages recompiles each package along with any les with names matching the pattern "*_test.go" go test with no arguments compiles and tests the package with source in the current directory
  • 9. The testing package $ go doc testing ... provides support for automated testing of Go packages. (...) used in concert with the ``go test'' command, which automates execution of any function of the form func TestXxx(*testing.T) ...
  • 10. Some methods of testing.T $ go doc testing.T func (c *T) Fail() func (c *T) FailNow() func (c *T) Log(args ...interface{}) func (c *T) Logf(format string, args ...interface{}) func (c *T) Error(args ...interface{}) func (c *T) Errorf(format string, args ...interface{}) func (c *T) Fatal(args ...interface{}) func (c *T) Fatalf(format string, args ...interface{})
  • 11. A minimal test le template foo_test.go package foo import "testing" func TestFoo(t *testing.T) { got := Foo() want := "bar" if got != want { t.Errorf("Foo() = %v, want %v", got, want) } }
  • 12. Table testing github.com/golang/go/wiki/TableDrivenTests func TestSame(t *testing.T) { tests := []struct { trees [2]*tree.Tree want bool }{ { trees: [2]*tree.Tree{tree.New(1), tree.New(1)}, want: true, }, { trees: [2]*tree.Tree{tree.New(1), tree.New(2)}, want: false, }, } for _, tt := range tests { if got := Same(tt.trees[0], tt.trees[1]); got != tt.want { t.Errorf("Same(%v, %v) = %v, want %v", tt.trees[0], tt.trees[1], got, tt.want) } } } Run
  • 13. Coding Dojo Change pairs Work on exercises using TDD Discuss di erent implementations with your partner TDD rules: Write a complete test case See it FAIL Make it PASS Refactor
  • 14. Exercises Basics: Loops and Functions: Sqrt Slices: Pic Maps: WordCount Fibonacci closure
  • 15. What if I don't have Go installed? You can code online using The Go Playground. Running tests there can be accomplished with a little trick, as in this example: play.golang.org/p/UhY6SqAdCu In the future, it may become easier to run tests in the playground: github.com/golang/go/issues/6511
  • 16. Exercises Methods and interfaces: Stringers: IPAddr Errors: Sqrt Readers: in nite stream of 'A' rot13Reader Images
  • 18. Coding Dojo Brno If you want to practice more TDD, we have weekly meetings: facebook.com/CodingDojoBrno
  • 19. Retrospective Code retreat style... What, if anything, did you learn today? What, if anything, surprised you today? What, if anything, would you like to do with Go in the future?
  • 20. Thank you Rodolfo Carvalho Red Hat rhcarvalho@gmail.com http://rodolfocarvalho.net https://dojo-brno.github.io