SlideShare une entreprise Scribd logo
1  sur  47
Télécharger pour lire hors ligne
Getting started with Go
24 Mar 2017
Florin Pățan
Cloud Services Engineer
YouView TV Ltd.
About me
gopher for ~4 years
the Communtiy version of Go plugin for IntelliJ maintainer
GoBridge Core Member - Workshop Logistics
Open-Source contributor
What is Go?
What is Go?
"Go is an open source programming language that makes it easy to build simple,
reliable, and e cient software."
golang.org(https://golang.org)
What is Go for me?
Go makes programming fun (again)
allows me to focus on the algorithm rather than how to implement the solution
mature community, growing at a good rate
Why should you learn Go?
Great mascot
Copyright Renee French
Join the Go side
Copyright "someone from the Internet"
If you are new to programming
Go is much simpler than many other languages
the syntax is not in your way
introduces the advanced concepts of concurrency w/o the usual overhead
exposure to how parts of the computer work
Disclaimer
Depending on your goals, Go might not be the very best language to learn as a
beginner. Languages such as Python or even Javascript might be more suitable.
If you know dynamic programming languages
type safety at compile time
syntax that sometimes feels like a dynamic language
simple and fast build system
much faster than the others (almost always)
single binary to deploy = love from your ops team
If you know C/C++/Java
fast compiler even with large projects
simpli ed syntax that allows you to focus on solving the problem
compiles to native code, cross-compiles to other OS-es (when possible)
can interact with C code via CGO
can be compiled to a binary with no external dependencies
If you are as an Ops person...
The main reason would be: better tools.
replace your complex bash scripts with testable Go apps
write tools that help you create / maintain infrastructure
write tools that help you simulate protocols interactions: github.com/adrianco/spigo
(https://github.com/adrianco/spigo)
all the new tools such as Docker, Kubernetes, CloudFoundry etc are written in Go
Go features
Go features
easy to read / write
statically typed
garbage collected
fast to compile
concurrency is baked into the language
functions are rst class citizens
composable types
interfaces satis ed implicitly
return multiple values
produces a single executable
cross platform, natively compiled
Go supported platforms
android/386 darwin/386
android/amd64 darwin/amd64
android/arm darwin/arm
android/arm64 darwin/arm64
windows/386 nacl/386
windows/amd64 nacl/amd64p32
linux/386 nacl/arm
linux/amd64 freebsd/386
linux/arm freebsd/amd64
linux/arm64 freebsd/arm
linux/mips dragonfly/amd64
linux/mips64 netbsd/386
linux/mips64le netbsd/amd64
linux/mipsle netbsd/arm
linux/ppc64 openbsd/386
linux/ppc64le openbsd/amd64
linux/s390x openbsd/arm
plan9/386 solaris/amd64
plan9/amd64
plan9/arm
Oh and Javascript via GopherJS
Go's missing features
generics
overloads
implicit type conversions
Go tooling
Go tooling
goimports (or gofmt)
golint and govet
go-staticcheck (or gometalinter)
guru
Go Playground(https://play.golang.org)
etc.
Write your own tools using go/ast package
Go editors
Gogland (or any other Jetbrains IDE)
VSCode
emacs
Atom
vim
LiteIDE
Sublime 3
many others
Is it production ready?
Users of Go out there
Google
CloudFlare
Canonical (Ubuntu)
Microsoft, Facebook, AWS, Heroku
rkt, Docker, Kubernetes
Almost all HashiCorp tools
List of Go users github.com/golang/go/wiki/GoUsers(https://github.com/golang/go/wiki/GoUsers)
Some success stories github.com/golang/go/wiki/SuccessStories(https://github.com/golang/go/wiki/SuccessStories)
Probably your are using Go w/o knowing
The maturity of the eco-system
A lot of libraries are very stable and battle tested
Go favors composition thus gophers are focusing on making interchangeable libraries
Concrete examples of mature libraries
To create a web app all you need is the standard library.
However, if you want to add some convenience:
gorilla/mux or httprouter (to handle the routing)
sqlx (for SQL database interaction)
go-mysql-driver / libpq
logrus or gokit/kit/log
gokit to enable overall better app design
The Go Community
Go Code of Conduct
Go has a Code of Conduct which enables gophers to be safe and welcomed in any
o cial Go environment as well as places which choose to adhere to it.
golang.org/conduct(https://golang.org/conduct)
Go Mailing Lists
We have a mailing list for general questions or Go related things
groups.google.com/forum/#!forum/golang-nuts(https://groups.google.com/forum/#!forum/golang-nuts)
We also have a mailing list for development of Go itself
groups.google.com/forum/#!forum/golang-dev(https://groups.google.com/forum/#!forum/golang-dev)
Go Forum
forum.golangbridge.org(https://forum.golangbridge.org)
Slack
gophers.slack.com(https://gophers.slack.com)
over 14500+ Gophers (growing at a rate of ~200 gophers / week)
one of the largest known open Slacks for programmers
gophers from everywhere in the World
usually most questions are answered in real-time by always friendly gophers
governed by an enhanced CoC, GoBridge speci c
Invites: https://invites.slack.golangbridge.org(https://invites.slack.golangbridge.org)
GoBridge
golangbridge.org(golangbridge.org)
GoBridge
Core mission
Our core mission is to enable minorities in tech to use Go as a tool to learn
and teach programming and, ultimately, to empower underrepresented groups in
tech to help increase diversity in the Go community.
GoBridge
How do we do this?
create safe spaces where everyone is welcomed
organize workshops
remote meetups
write training material
teach the teachers / organizers
try and connect organizers with sponsors
Resources
O cial
The language tour: tour.golang.org(https://tour.golang.org)
O cial:
golang.org/doc/code.html(https://golang.org/doc/code.html)- to learn how to organize your Go workspace
golang.org/doc/e ective_go.html(https://golang.org/doc/e ective_go.html)- be more e ective at writing Go
golang.org/ref/spec(https://golang.org/ref/spec)- learn more about the language itself
golang.org/doc/#articles(https://golang.org/doc/#articles)- a lot more reading material
blog.golang.org(https://blog.golang.org)- the Go blog
And you can nd even more material here: github.com/golang/go/wiki(https://github.com/golang/go/wiki)
Websites
There are some awesome websites as well:
blog.gopheracademy.com(https://blog.gopheracademy.com)- great resources for Gophers in general
gotime.fm(http://gotime.fm)- awesome weekly podcast of Go awesomeness
gobyexample.com(https://gobyexample.com)- examples of how to do things in Go
go-database-sql.org(http://go-database-sql.org)- how to use SQL databases in Go
gophervids.appspot.com(http://gophervids.appspot.com)- list of Go related videos from various authors
Blogs, social media & meetups
Peter Bourgon @peterbourgon(https://twitter.com/peterbourgon)- peter.bourgon.org/blog(https://peter.bourgon.org/blog)
Carlisia Campos @carlisia(https://twitter.com/carlisia)
Dave Cheney @davecheney(https://twitter.com/davecheney)- dave.cheney.net(http://dave.cheney.net)
Jaana Burcu Dogan @rakyll(https://twitter.com/rakyll)- golang.rakyll.org(http://golang.rakyll.org)
Jessie Frazelle @jessfraz(https://twitter.com/jessfraz)- blog.jessfraz.com(https://blog.jessfraz.com)
William "Bill" Kennedy @goinggodotnet(https://twitter.com)- www.goinggo.net(https://www.goinggo.net)
Brian Ketelsen @bketelsen(https://twitter.com/bketelsen)- www.brianketelsen.com/blog
(https://www.brianketelsen.com/blog)
List of Go meetups go-meetups.appspot.com(https://go-meetups.appspot.com)
GolangIT www.meetup.com/golangit(https://www.meetup.com/golangit)
Books
The Go Programming Language www.gopl.io(http://www.gopl.io)
Go In Action www.manning.com/books/go-in-action(https://www.manning.com/books/go-in-action)
For more books, see: github.com/golang/go/wiki/Books(https://github.com/golang/go/wiki/Books)
Final thoughts
What is Go?
a general purpose cross-platform programming language
optimized for readability and maintenance (and speed)
it's particularly good for networking, service side long running processes and tools
great in 80% of the times for 100% of those tasks
For me:
it's easy, fun yet very powerful even with all it's quirks
it made me rethink the way I program in other languages
it has a great community and a very bright future ahead
One last thing
One last thing
package main
import "fmt"
func main() {
fmt.Println("Hello CodeMotion!")
} Run
One more one last thing
func powersOf(what float64, wait *sync.WaitGroup, result chan float64) {
for i := float64(0); i <= 100; i++ {
result <- math.Pow(what, i)
}
wait.Done()
}
func main() {
wait := &sync.WaitGroup{}
result := make(chan float64, 10000000)
for i := float64(1); i <= 100; i++ {
wait.Add(1)
go powersOf(i, wait, result)
}
wait.Wait()
var sum float64
for len(result) > 0 {
sum += <-result
}
fmt.Printf("Sum is: %.0fn", sum)
} Run
Credits
Jud White(https://github.com/judwhite)for the supported arch listing from Go: A Practical Start Guide
(http://go-talks.appspot.com/github.com/judwhite/talks-dell/talk.slide)
Questions
Thank you
24 Mar 2017
Florin Pățan
Cloud Services Engineer
YouView TV Ltd.
orinpatan@gmail.com(mailto: orinpatan@gmail.com)
http://github.com/dlsniper(http://github.com/dlsniper)
@dlsniper(http://twitter.com/dlsniper)
Getting started with Go - Florin Patan - Codemotion Rome 2017

Contenu connexe

Tendances

Tendances (20)

Golang - Overview of Go (golang) Language
Golang - Overview of Go (golang) LanguageGolang - Overview of Go (golang) Language
Golang - Overview of Go (golang) Language
 
Introduction to GoLang
Introduction to GoLangIntroduction to GoLang
Introduction to GoLang
 
GoLang Introduction
GoLang IntroductionGoLang Introduction
GoLang Introduction
 
Go Lang
Go LangGo Lang
Go Lang
 
Developing for LinkedIn's Application Platform
Developing for LinkedIn's Application PlatformDeveloping for LinkedIn's Application Platform
Developing for LinkedIn's Application Platform
 
Go lang
Go langGo lang
Go lang
 
Golang from Scala developer’s perspective
Golang from Scala developer’s perspectiveGolang from Scala developer’s perspective
Golang from Scala developer’s perspective
 
really really really awesome php application with bdd behat and iterfaces
really really really awesome php application with bdd behat and iterfacesreally really really awesome php application with bdd behat and iterfaces
really really really awesome php application with bdd behat and iterfaces
 
Let the contribution begin
Let the contribution beginLet the contribution begin
Let the contribution begin
 
Let the contribution begin (EST futures)
Let the contribution begin  (EST futures)Let the contribution begin  (EST futures)
Let the contribution begin (EST futures)
 
RESTful API Development using Go
RESTful API Development using GoRESTful API Development using Go
RESTful API Development using Go
 
Lets Go - An introduction to Google's Go Programming Language
Lets Go - An introduction to Google's Go Programming Language Lets Go - An introduction to Google's Go Programming Language
Lets Go - An introduction to Google's Go Programming Language
 
Where's the source, Luke? : How to find and debug the code behind Plone
Where's the source, Luke? : How to find and debug the code behind PloneWhere's the source, Luke? : How to find and debug the code behind Plone
Where's the source, Luke? : How to find and debug the code behind Plone
 
Golang online course
Golang online courseGolang online course
Golang online course
 
Lennart Regebro What Zope Did Wrong (And What To Do Instead)
Lennart Regebro   What Zope Did Wrong (And What To Do Instead)Lennart Regebro   What Zope Did Wrong (And What To Do Instead)
Lennart Regebro What Zope Did Wrong (And What To Do Instead)
 
iTHome Gopher Day 2017: What can Golang do? (Using project 52 as examples)
iTHome Gopher Day 2017: What can Golang do?  (Using project 52 as examples)iTHome Gopher Day 2017: What can Golang do?  (Using project 52 as examples)
iTHome Gopher Day 2017: What can Golang do? (Using project 52 as examples)
 
Golang presentaion-2018-07-26
Golang presentaion-2018-07-26Golang presentaion-2018-07-26
Golang presentaion-2018-07-26
 
PHP for Android: prototyping Android apps in php
PHP for Android: prototyping Android apps in phpPHP for Android: prototyping Android apps in php
PHP for Android: prototyping Android apps in php
 
Driving development in PHP
Driving development in PHPDriving development in PHP
Driving development in PHP
 
Graalvm with Groovy and Kotlin - Greach 2019
Graalvm with Groovy and Kotlin - Greach 2019Graalvm with Groovy and Kotlin - Greach 2019
Graalvm with Groovy and Kotlin - Greach 2019
 

Similaire à Getting started with Go - Florin Patan - Codemotion Rome 2017

Similaire à Getting started with Go - Florin Patan - Codemotion Rome 2017 (20)

Getting started with go - Florin Patan - Codemotion Milan 2016
Getting started with go - Florin Patan - Codemotion Milan 2016Getting started with go - Florin Patan - Codemotion Milan 2016
Getting started with go - Florin Patan - Codemotion Milan 2016
 
Resources For Floss Projects
Resources For Floss ProjectsResources For Floss Projects
Resources For Floss Projects
 
Beginning development in go
Beginning development in goBeginning development in go
Beginning development in go
 
Introduction to Go
Introduction to GoIntroduction to Go
Introduction to Go
 
Open Source for Women / Girl Geeks
Open Source for Women / Girl GeeksOpen Source for Women / Girl Geeks
Open Source for Women / Girl Geeks
 
Introduction to go lang
Introduction to go langIntroduction to go lang
Introduction to go lang
 
Scaling applications with go
Scaling applications with goScaling applications with go
Scaling applications with go
 
GSoC: How to get prepared and write a good proposal (or how to start contribu...
GSoC: How to get prepared and write a good proposal (or how to start contribu...GSoC: How to get prepared and write a good proposal (or how to start contribu...
GSoC: How to get prepared and write a good proposal (or how to start contribu...
 
R1-intro-to-go.pptx
R1-intro-to-go.pptxR1-intro-to-go.pptx
R1-intro-to-go.pptx
 
Hacktoberfest 2020 - Open source for beginners
Hacktoberfest 2020 - Open source for beginnersHacktoberfest 2020 - Open source for beginners
Hacktoberfest 2020 - Open source for beginners
 
Open event (show&tell april 2016)
Open event (show&tell april 2016)Open event (show&tell april 2016)
Open event (show&tell april 2016)
 
Android is going to Go! - Android and goland - Almog Baku
Android is going to Go! - Android and goland - Almog BakuAndroid is going to Go! - Android and goland - Almog Baku
Android is going to Go! - Android and goland - Almog Baku
 
Android is going to Go! Android and Golang
Android is going to Go! Android and GolangAndroid is going to Go! Android and Golang
Android is going to Go! Android and Golang
 
Developing FirefoxOS
Developing FirefoxOSDeveloping FirefoxOS
Developing FirefoxOS
 
Bootstrapping Tools and Practices
Bootstrapping Tools and PracticesBootstrapping Tools and Practices
Bootstrapping Tools and Practices
 
Open source and then some: An Introduction
Open source and then some: An IntroductionOpen source and then some: An Introduction
Open source and then some: An Introduction
 
Advantages of golang development services &amp; 10 most used go frameworks
Advantages of golang development services &amp; 10 most used go frameworksAdvantages of golang development services &amp; 10 most used go frameworks
Advantages of golang development services &amp; 10 most used go frameworks
 
Let's Go: Introduction to Google's Go Programming Language
Let's Go: Introduction to Google's Go Programming LanguageLet's Go: Introduction to Google's Go Programming Language
Let's Go: Introduction to Google's Go Programming Language
 
Write microservice in golang
Write microservice in golangWrite microservice in golang
Write microservice in golang
 
welcome to gopherlabs - why go (golang)?
welcome to gopherlabs - why go (golang)?welcome to gopherlabs - why go (golang)?
welcome to gopherlabs - why go (golang)?
 

Plus de Codemotion

Plus de Codemotion (20)

Fuzz-testing: A hacker's approach to making your code more secure | Pascal Ze...
Fuzz-testing: A hacker's approach to making your code more secure | Pascal Ze...Fuzz-testing: A hacker's approach to making your code more secure | Pascal Ze...
Fuzz-testing: A hacker's approach to making your code more secure | Pascal Ze...
 
Pompili - From hero to_zero: The FatalNoise neverending story
Pompili - From hero to_zero: The FatalNoise neverending storyPompili - From hero to_zero: The FatalNoise neverending story
Pompili - From hero to_zero: The FatalNoise neverending story
 
Pastore - Commodore 65 - La storia
Pastore - Commodore 65 - La storiaPastore - Commodore 65 - La storia
Pastore - Commodore 65 - La storia
 
Pennisi - Essere Richard Altwasser
Pennisi - Essere Richard AltwasserPennisi - Essere Richard Altwasser
Pennisi - Essere Richard Altwasser
 
Michel Schudel - Let's build a blockchain... in 40 minutes! - Codemotion Amst...
Michel Schudel - Let's build a blockchain... in 40 minutes! - Codemotion Amst...Michel Schudel - Let's build a blockchain... in 40 minutes! - Codemotion Amst...
Michel Schudel - Let's build a blockchain... in 40 minutes! - Codemotion Amst...
 
Richard Süselbeck - Building your own ride share app - Codemotion Amsterdam 2019
Richard Süselbeck - Building your own ride share app - Codemotion Amsterdam 2019Richard Süselbeck - Building your own ride share app - Codemotion Amsterdam 2019
Richard Süselbeck - Building your own ride share app - Codemotion Amsterdam 2019
 
Eward Driehuis - What we learned from 20.000 attacks - Codemotion Amsterdam 2019
Eward Driehuis - What we learned from 20.000 attacks - Codemotion Amsterdam 2019Eward Driehuis - What we learned from 20.000 attacks - Codemotion Amsterdam 2019
Eward Driehuis - What we learned from 20.000 attacks - Codemotion Amsterdam 2019
 
Francesco Baldassarri - Deliver Data at Scale - Codemotion Amsterdam 2019 -
Francesco Baldassarri  - Deliver Data at Scale - Codemotion Amsterdam 2019 - Francesco Baldassarri  - Deliver Data at Scale - Codemotion Amsterdam 2019 -
Francesco Baldassarri - Deliver Data at Scale - Codemotion Amsterdam 2019 -
 
Martin Förtsch, Thomas Endres - Stereoscopic Style Transfer AI - Codemotion A...
Martin Förtsch, Thomas Endres - Stereoscopic Style Transfer AI - Codemotion A...Martin Förtsch, Thomas Endres - Stereoscopic Style Transfer AI - Codemotion A...
Martin Förtsch, Thomas Endres - Stereoscopic Style Transfer AI - Codemotion A...
 
Melanie Rieback, Klaus Kursawe - Blockchain Security: Melting the "Silver Bul...
Melanie Rieback, Klaus Kursawe - Blockchain Security: Melting the "Silver Bul...Melanie Rieback, Klaus Kursawe - Blockchain Security: Melting the "Silver Bul...
Melanie Rieback, Klaus Kursawe - Blockchain Security: Melting the "Silver Bul...
 
Angelo van der Sijpt - How well do you know your network stack? - Codemotion ...
Angelo van der Sijpt - How well do you know your network stack? - Codemotion ...Angelo van der Sijpt - How well do you know your network stack? - Codemotion ...
Angelo van der Sijpt - How well do you know your network stack? - Codemotion ...
 
Lars Wolff - Performance Testing for DevOps in the Cloud - Codemotion Amsterd...
Lars Wolff - Performance Testing for DevOps in the Cloud - Codemotion Amsterd...Lars Wolff - Performance Testing for DevOps in the Cloud - Codemotion Amsterd...
Lars Wolff - Performance Testing for DevOps in the Cloud - Codemotion Amsterd...
 
Sascha Wolter - Conversational AI Demystified - Codemotion Amsterdam 2019
Sascha Wolter - Conversational AI Demystified - Codemotion Amsterdam 2019Sascha Wolter - Conversational AI Demystified - Codemotion Amsterdam 2019
Sascha Wolter - Conversational AI Demystified - Codemotion Amsterdam 2019
 
Michele Tonutti - Scaling is caring - Codemotion Amsterdam 2019
Michele Tonutti - Scaling is caring - Codemotion Amsterdam 2019Michele Tonutti - Scaling is caring - Codemotion Amsterdam 2019
Michele Tonutti - Scaling is caring - Codemotion Amsterdam 2019
 
Pat Hermens - From 100 to 1,000+ deployments a day - Codemotion Amsterdam 2019
Pat Hermens - From 100 to 1,000+ deployments a day - Codemotion Amsterdam 2019Pat Hermens - From 100 to 1,000+ deployments a day - Codemotion Amsterdam 2019
Pat Hermens - From 100 to 1,000+ deployments a day - Codemotion Amsterdam 2019
 
James Birnie - Using Many Worlds of Compute Power with Quantum - Codemotion A...
James Birnie - Using Many Worlds of Compute Power with Quantum - Codemotion A...James Birnie - Using Many Worlds of Compute Power with Quantum - Codemotion A...
James Birnie - Using Many Worlds of Compute Power with Quantum - Codemotion A...
 
Don Goodman-Wilson - Chinese food, motor scooters, and open source developmen...
Don Goodman-Wilson - Chinese food, motor scooters, and open source developmen...Don Goodman-Wilson - Chinese food, motor scooters, and open source developmen...
Don Goodman-Wilson - Chinese food, motor scooters, and open source developmen...
 
Pieter Omvlee - The story behind Sketch - Codemotion Amsterdam 2019
Pieter Omvlee - The story behind Sketch - Codemotion Amsterdam 2019Pieter Omvlee - The story behind Sketch - Codemotion Amsterdam 2019
Pieter Omvlee - The story behind Sketch - Codemotion Amsterdam 2019
 
Dave Farley - Taking Back “Software Engineering” - Codemotion Amsterdam 2019
Dave Farley - Taking Back “Software Engineering” - Codemotion Amsterdam 2019Dave Farley - Taking Back “Software Engineering” - Codemotion Amsterdam 2019
Dave Farley - Taking Back “Software Engineering” - Codemotion Amsterdam 2019
 
Joshua Hoffman - Should the CTO be Coding? - Codemotion Amsterdam 2019
Joshua Hoffman - Should the CTO be Coding? - Codemotion Amsterdam 2019Joshua Hoffman - Should the CTO be Coding? - Codemotion Amsterdam 2019
Joshua Hoffman - Should the CTO be Coding? - Codemotion Amsterdam 2019
 

Dernier

Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Safe Software
 

Dernier (20)

Apidays Singapore 2024 - Scalable LLM APIs for AI and Generative AI Applicati...
Apidays Singapore 2024 - Scalable LLM APIs for AI and Generative AI Applicati...Apidays Singapore 2024 - Scalable LLM APIs for AI and Generative AI Applicati...
Apidays Singapore 2024 - Scalable LLM APIs for AI and Generative AI Applicati...
 
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ..."I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
 
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingRepurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
 
GenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdfGenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdf
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
 
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a Fresher
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
 
A Beginners Guide to Building a RAG App Using Open Source Milvus
A Beginners Guide to Building a RAG App Using Open Source MilvusA Beginners Guide to Building a RAG App Using Open Source Milvus
A Beginners Guide to Building a RAG App Using Open Source Milvus
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 
Apidays Singapore 2024 - Modernizing Securities Finance by Madhu Subbu
Apidays Singapore 2024 - Modernizing Securities Finance by Madhu SubbuApidays Singapore 2024 - Modernizing Securities Finance by Madhu Subbu
Apidays Singapore 2024 - Modernizing Securities Finance by Madhu Subbu
 
AXA XL - Insurer Innovation Award Americas 2024
AXA XL - Insurer Innovation Award Americas 2024AXA XL - Insurer Innovation Award Americas 2024
AXA XL - Insurer Innovation Award Americas 2024
 
Manulife - Insurer Transformation Award 2024
Manulife - Insurer Transformation Award 2024Manulife - Insurer Transformation Award 2024
Manulife - Insurer Transformation Award 2024
 
MS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectorsMS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectors
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
 
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
 

Getting started with Go - Florin Patan - Codemotion Rome 2017

  • 1. Getting started with Go 24 Mar 2017 Florin Pățan Cloud Services Engineer YouView TV Ltd.
  • 2. About me gopher for ~4 years the Communtiy version of Go plugin for IntelliJ maintainer GoBridge Core Member - Workshop Logistics Open-Source contributor
  • 4. What is Go? "Go is an open source programming language that makes it easy to build simple, reliable, and e cient software." golang.org(https://golang.org)
  • 5.
  • 6. What is Go for me? Go makes programming fun (again) allows me to focus on the algorithm rather than how to implement the solution mature community, growing at a good rate
  • 7. Why should you learn Go?
  • 9. Join the Go side Copyright "someone from the Internet"
  • 10. If you are new to programming Go is much simpler than many other languages the syntax is not in your way introduces the advanced concepts of concurrency w/o the usual overhead exposure to how parts of the computer work Disclaimer Depending on your goals, Go might not be the very best language to learn as a beginner. Languages such as Python or even Javascript might be more suitable.
  • 11. If you know dynamic programming languages type safety at compile time syntax that sometimes feels like a dynamic language simple and fast build system much faster than the others (almost always) single binary to deploy = love from your ops team
  • 12. If you know C/C++/Java fast compiler even with large projects simpli ed syntax that allows you to focus on solving the problem compiles to native code, cross-compiles to other OS-es (when possible) can interact with C code via CGO can be compiled to a binary with no external dependencies
  • 13. If you are as an Ops person... The main reason would be: better tools. replace your complex bash scripts with testable Go apps write tools that help you create / maintain infrastructure write tools that help you simulate protocols interactions: github.com/adrianco/spigo (https://github.com/adrianco/spigo) all the new tools such as Docker, Kubernetes, CloudFoundry etc are written in Go
  • 15. Go features easy to read / write statically typed garbage collected fast to compile concurrency is baked into the language functions are rst class citizens composable types interfaces satis ed implicitly return multiple values produces a single executable cross platform, natively compiled
  • 16. Go supported platforms android/386 darwin/386 android/amd64 darwin/amd64 android/arm darwin/arm android/arm64 darwin/arm64 windows/386 nacl/386 windows/amd64 nacl/amd64p32 linux/386 nacl/arm linux/amd64 freebsd/386 linux/arm freebsd/amd64 linux/arm64 freebsd/arm linux/mips dragonfly/amd64 linux/mips64 netbsd/386 linux/mips64le netbsd/amd64 linux/mipsle netbsd/arm linux/ppc64 openbsd/386 linux/ppc64le openbsd/amd64 linux/s390x openbsd/arm plan9/386 solaris/amd64 plan9/amd64 plan9/arm Oh and Javascript via GopherJS
  • 19. Go tooling goimports (or gofmt) golint and govet go-staticcheck (or gometalinter) guru Go Playground(https://play.golang.org) etc. Write your own tools using go/ast package
  • 20. Go editors Gogland (or any other Jetbrains IDE) VSCode emacs Atom vim LiteIDE Sublime 3 many others
  • 22. Users of Go out there Google CloudFlare Canonical (Ubuntu) Microsoft, Facebook, AWS, Heroku rkt, Docker, Kubernetes Almost all HashiCorp tools List of Go users github.com/golang/go/wiki/GoUsers(https://github.com/golang/go/wiki/GoUsers) Some success stories github.com/golang/go/wiki/SuccessStories(https://github.com/golang/go/wiki/SuccessStories) Probably your are using Go w/o knowing
  • 23. The maturity of the eco-system A lot of libraries are very stable and battle tested Go favors composition thus gophers are focusing on making interchangeable libraries
  • 24. Concrete examples of mature libraries To create a web app all you need is the standard library. However, if you want to add some convenience: gorilla/mux or httprouter (to handle the routing) sqlx (for SQL database interaction) go-mysql-driver / libpq logrus or gokit/kit/log gokit to enable overall better app design
  • 26. Go Code of Conduct Go has a Code of Conduct which enables gophers to be safe and welcomed in any o cial Go environment as well as places which choose to adhere to it. golang.org/conduct(https://golang.org/conduct)
  • 27. Go Mailing Lists We have a mailing list for general questions or Go related things groups.google.com/forum/#!forum/golang-nuts(https://groups.google.com/forum/#!forum/golang-nuts) We also have a mailing list for development of Go itself groups.google.com/forum/#!forum/golang-dev(https://groups.google.com/forum/#!forum/golang-dev)
  • 29. Slack gophers.slack.com(https://gophers.slack.com) over 14500+ Gophers (growing at a rate of ~200 gophers / week) one of the largest known open Slacks for programmers gophers from everywhere in the World usually most questions are answered in real-time by always friendly gophers governed by an enhanced CoC, GoBridge speci c Invites: https://invites.slack.golangbridge.org(https://invites.slack.golangbridge.org)
  • 31.
  • 32. GoBridge Core mission Our core mission is to enable minorities in tech to use Go as a tool to learn and teach programming and, ultimately, to empower underrepresented groups in tech to help increase diversity in the Go community.
  • 33. GoBridge How do we do this? create safe spaces where everyone is welcomed organize workshops remote meetups write training material teach the teachers / organizers try and connect organizers with sponsors
  • 35. O cial The language tour: tour.golang.org(https://tour.golang.org) O cial: golang.org/doc/code.html(https://golang.org/doc/code.html)- to learn how to organize your Go workspace golang.org/doc/e ective_go.html(https://golang.org/doc/e ective_go.html)- be more e ective at writing Go golang.org/ref/spec(https://golang.org/ref/spec)- learn more about the language itself golang.org/doc/#articles(https://golang.org/doc/#articles)- a lot more reading material blog.golang.org(https://blog.golang.org)- the Go blog And you can nd even more material here: github.com/golang/go/wiki(https://github.com/golang/go/wiki)
  • 36. Websites There are some awesome websites as well: blog.gopheracademy.com(https://blog.gopheracademy.com)- great resources for Gophers in general gotime.fm(http://gotime.fm)- awesome weekly podcast of Go awesomeness gobyexample.com(https://gobyexample.com)- examples of how to do things in Go go-database-sql.org(http://go-database-sql.org)- how to use SQL databases in Go gophervids.appspot.com(http://gophervids.appspot.com)- list of Go related videos from various authors
  • 37. Blogs, social media & meetups Peter Bourgon @peterbourgon(https://twitter.com/peterbourgon)- peter.bourgon.org/blog(https://peter.bourgon.org/blog) Carlisia Campos @carlisia(https://twitter.com/carlisia) Dave Cheney @davecheney(https://twitter.com/davecheney)- dave.cheney.net(http://dave.cheney.net) Jaana Burcu Dogan @rakyll(https://twitter.com/rakyll)- golang.rakyll.org(http://golang.rakyll.org) Jessie Frazelle @jessfraz(https://twitter.com/jessfraz)- blog.jessfraz.com(https://blog.jessfraz.com) William "Bill" Kennedy @goinggodotnet(https://twitter.com)- www.goinggo.net(https://www.goinggo.net) Brian Ketelsen @bketelsen(https://twitter.com/bketelsen)- www.brianketelsen.com/blog (https://www.brianketelsen.com/blog) List of Go meetups go-meetups.appspot.com(https://go-meetups.appspot.com) GolangIT www.meetup.com/golangit(https://www.meetup.com/golangit)
  • 38. Books The Go Programming Language www.gopl.io(http://www.gopl.io) Go In Action www.manning.com/books/go-in-action(https://www.manning.com/books/go-in-action) For more books, see: github.com/golang/go/wiki/Books(https://github.com/golang/go/wiki/Books)
  • 40. What is Go? a general purpose cross-platform programming language optimized for readability and maintenance (and speed) it's particularly good for networking, service side long running processes and tools great in 80% of the times for 100% of those tasks For me: it's easy, fun yet very powerful even with all it's quirks it made me rethink the way I program in other languages it has a great community and a very bright future ahead
  • 42. One last thing package main import "fmt" func main() { fmt.Println("Hello CodeMotion!") } Run
  • 43. One more one last thing func powersOf(what float64, wait *sync.WaitGroup, result chan float64) { for i := float64(0); i <= 100; i++ { result <- math.Pow(what, i) } wait.Done() } func main() { wait := &sync.WaitGroup{} result := make(chan float64, 10000000) for i := float64(1); i <= 100; i++ { wait.Add(1) go powersOf(i, wait, result) } wait.Wait() var sum float64 for len(result) > 0 { sum += <-result } fmt.Printf("Sum is: %.0fn", sum) } Run
  • 44. Credits Jud White(https://github.com/judwhite)for the supported arch listing from Go: A Practical Start Guide (http://go-talks.appspot.com/github.com/judwhite/talks-dell/talk.slide)
  • 46. Thank you 24 Mar 2017 Florin Pățan Cloud Services Engineer YouView TV Ltd. orinpatan@gmail.com(mailto: orinpatan@gmail.com) http://github.com/dlsniper(http://github.com/dlsniper) @dlsniper(http://twitter.com/dlsniper)