SlideShare a Scribd company logo
1 of 17
A Short Intro to Go
CS 240 – Fall 2018
Rec. 1
Some Housekeeping
• Make sure you are on Piazza
• Come to OH if you can’t install Go
• Start Assignment 1
• Let us know on the Piazza poll if this recitation is
too basic or advanced
Basic Advanced
You’re not a Business Major
Stop Saving File Versions Like this:
You’re a CS Major – Use Git
COMMAND WHAT IT DOES
git init Start recording changes in this
directory
git add Include this file in the next snapshot
git commit Take a snapshot (commit)
git reset Go back to the last snapshot (commit)
git checkout a Go to snapshot a
Resources to Learn Git:
https://try.github.io/
Course website (Assignments):
http://web.kaust.edu.sa/Faculty/MarcoCanini/classes/CS240/F18/assignm
ents.html
DEMO?
“Go is a
compiled,
concurrent,
statically typed,
garbage-collected
language developed at Google”
- Rob Pike, 2012
What’s this Weird Language I’ve Never Heard of?
Rob Pike is the Jeff Dean of distributed systems. Here’s the article the quote is from: https://talks.golang.org/2012/splash.article
compiled Like C, C++
concurrent Like Erlang
statically typed Like C, C++, Java
garbage-collected Like Java and Python
What’s this Weird Language I’ve Never Heard of?
Why Not Use Python, Java, C++, etc?
Built for Systems.
Go preserves efficiency but has good abstractions.
Easy multi threading and IO communication.
Develop quickly
Do many things efficiently and at the same time
Official Self Reported List of Companies that use Go: https://github.com/golang/go/wiki/GoUsers
Seems Google Specific. Who Else Actually Uses it?
Why did they Choose Go?
“We built everything in Python because it was easy,
but now it’s slow. So we switched to Go.”
- Most companies using Go
But How do I Use Go?
Start here:
https://tour.golang.org/list
Didn’t install Go? Use the web IDE:
https://play.golang.org/
Other Resources:
Go for Pythonists
https://talks.golang.org/2013/go4python.slide#1
Go for Distributed Systems
https://talks.golang.org/2013/distsys.slide#1
Official Go Talks
https://github.com/golang/go/wiki/GoTalks
But How do I Use Go?
DEMO
What About Object in Go?
DEMO
Build Software for Any System
go build file.go
Compile an executable for your machine
env GOOS=windows GOARCH=amd64 go build file.go
Compile an executable for Windows with 64 bit processor
DEMO?
Format your Code
COMMAND WHAT IT DOES
go fmt file.go Format the file.go properly
DEMO
Wait, I Have Questions!
Go’s official
“Frequently Asked Questions (FAQ)”
https://golang.org/doc/faq
Some Advice for the Assignments
• Write modular code
• Use comments (even to yourself)
• Don’t forget go fmt (graded)
• The clearer your code is, the
more we can help with bugs

More Related Content

Similar to R1-intro-to-go.pptx

Open up your platform with Open Source and GitHub
Open up your platform with Open Source and GitHubOpen up your platform with Open Source and GitHub
Open up your platform with Open Source and GitHubScott Graham
 
Write microservice in golang
Write microservice in golangWrite microservice in golang
Write microservice in golangBo-Yi Wu
 
Github 101 An Adventurer's Guide To Open Source
Github 101   An Adventurer's Guide To Open SourceGithub 101   An Adventurer's Guide To Open Source
Github 101 An Adventurer's Guide To Open SourcePrachitibhukan
 
Github for Serious Business Professional
Github for Serious Business ProfessionalGithub for Serious Business Professional
Github for Serious Business Professionalzwheller
 
La importancia de versionar el código: GitHub, portafolio y recursos para est...
La importancia de versionar el código: GitHub, portafolio y recursos para est...La importancia de versionar el código: GitHub, portafolio y recursos para est...
La importancia de versionar el código: GitHub, portafolio y recursos para est...CloudNativeElSalvado
 
Beginner Workshop for Student Developers - Tratech-presentation.pdf
Beginner Workshop for Student Developers - Tratech-presentation.pdfBeginner Workshop for Student Developers - Tratech-presentation.pdf
Beginner Workshop for Student Developers - Tratech-presentation.pdfGDSCKNUST
 
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 2016Codemotion
 
Untangling fall2017 week2_try2
Untangling fall2017 week2_try2Untangling fall2017 week2_try2
Untangling fall2017 week2_try2Derek Jacoby
 
Untangling fall2017 week2
Untangling fall2017 week2Untangling fall2017 week2
Untangling fall2017 week2Derek Jacoby
 
Que nos espera a los ALM Dudes para el 2013?
Que nos espera a los ALM Dudes para el 2013?Que nos espera a los ALM Dudes para el 2013?
Que nos espera a los ALM Dudes para el 2013?Bruno Capuano
 
Scaling applications with go
Scaling applications with goScaling applications with go
Scaling applications with goVimlesh Sharma
 
Introduction to go
Introduction to goIntroduction to go
Introduction to goAnthony Chow
 
GitLab webcast - Release 8.4
GitLab webcast - Release 8.4GitLab webcast - Release 8.4
GitLab webcast - Release 8.4GitLab, Inc
 
Git single branch
Git single branchGit single branch
Git single branchCarl Brown
 
Workflows using Git GitHub | Edureka
Workflows using Git GitHub | EdurekaWorkflows using Git GitHub | Edureka
Workflows using Git GitHub | EdurekaEdureka!
 
Best practices-for-production-environments
Best practices-for-production-environmentsBest practices-for-production-environments
Best practices-for-production-environmentsArtem Kovardin
 

Similar to R1-intro-to-go.pptx (20)

Open up your platform with Open Source and GitHub
Open up your platform with Open Source and GitHubOpen up your platform with Open Source and GitHub
Open up your platform with Open Source and GitHub
 
Write microservice in golang
Write microservice in golangWrite microservice in golang
Write microservice in golang
 
Github 101 An Adventurer's Guide To Open Source
Github 101   An Adventurer's Guide To Open SourceGithub 101   An Adventurer's Guide To Open Source
Github 101 An Adventurer's Guide To Open Source
 
Github for Serious Business Professional
Github for Serious Business ProfessionalGithub for Serious Business Professional
Github for Serious Business Professional
 
La importancia de versionar el código: GitHub, portafolio y recursos para est...
La importancia de versionar el código: GitHub, portafolio y recursos para est...La importancia de versionar el código: GitHub, portafolio y recursos para est...
La importancia de versionar el código: GitHub, portafolio y recursos para est...
 
An Introduction to Go
An Introduction to GoAn Introduction to Go
An Introduction to Go
 
Introduction to git & github
Introduction to git & githubIntroduction to git & github
Introduction to git & github
 
Beginner Workshop for Student Developers - Tratech-presentation.pdf
Beginner Workshop for Student Developers - Tratech-presentation.pdfBeginner Workshop for Student Developers - Tratech-presentation.pdf
Beginner Workshop for Student Developers - Tratech-presentation.pdf
 
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
 
Untangling fall2017 week2_try2
Untangling fall2017 week2_try2Untangling fall2017 week2_try2
Untangling fall2017 week2_try2
 
Untangling fall2017 week2
Untangling fall2017 week2Untangling fall2017 week2
Untangling fall2017 week2
 
Que nos espera a los ALM Dudes para el 2013?
Que nos espera a los ALM Dudes para el 2013?Que nos espera a los ALM Dudes para el 2013?
Que nos espera a los ALM Dudes para el 2013?
 
Scaling applications with go
Scaling applications with goScaling applications with go
Scaling applications with go
 
GIT from n00b
GIT from n00bGIT from n00b
GIT from n00b
 
Introduction to go
Introduction to goIntroduction to go
Introduction to go
 
GitLab webcast - Release 8.4
GitLab webcast - Release 8.4GitLab webcast - Release 8.4
GitLab webcast - Release 8.4
 
Git single branch
Git single branchGit single branch
Git single branch
 
Workflows using Git GitHub | Edureka
Workflows using Git GitHub | EdurekaWorkflows using Git GitHub | Edureka
Workflows using Git GitHub | Edureka
 
Best practices-for-production-environments
Best practices-for-production-environmentsBest practices-for-production-environments
Best practices-for-production-environments
 
Intro. to Git and Github
Intro. to Git and GithubIntro. to Git and Github
Intro. to Git and Github
 

Recently uploaded

Electronically Controlled suspensions system .pdf
Electronically Controlled suspensions system .pdfElectronically Controlled suspensions system .pdf
Electronically Controlled suspensions system .pdfme23b1001
 
Call Us ≽ 8377877756 ≼ Call Girls In Shastri Nagar (Delhi)
Call Us ≽ 8377877756 ≼ Call Girls In Shastri Nagar (Delhi)Call Us ≽ 8377877756 ≼ Call Girls In Shastri Nagar (Delhi)
Call Us ≽ 8377877756 ≼ Call Girls In Shastri Nagar (Delhi)dollysharma2066
 
Work Experience-Dalton Park.pptxfvvvvvvv
Work Experience-Dalton Park.pptxfvvvvvvvWork Experience-Dalton Park.pptxfvvvvvvv
Work Experience-Dalton Park.pptxfvvvvvvvLewisJB
 
CCS355 Neural Network & Deep Learning UNIT III notes and Question bank .pdf
CCS355 Neural Network & Deep Learning UNIT III notes and Question bank .pdfCCS355 Neural Network & Deep Learning UNIT III notes and Question bank .pdf
CCS355 Neural Network & Deep Learning UNIT III notes and Question bank .pdfAsst.prof M.Gokilavani
 
Internship report on mechanical engineering
Internship report on mechanical engineeringInternship report on mechanical engineering
Internship report on mechanical engineeringmalavadedarshan25
 
main PPT.pptx of girls hostel security using rfid
main PPT.pptx of girls hostel security using rfidmain PPT.pptx of girls hostel security using rfid
main PPT.pptx of girls hostel security using rfidNikhilNagaraju
 
complete construction, environmental and economics information of biomass com...
complete construction, environmental and economics information of biomass com...complete construction, environmental and economics information of biomass com...
complete construction, environmental and economics information of biomass com...asadnawaz62
 
Software and Systems Engineering Standards: Verification and Validation of Sy...
Software and Systems Engineering Standards: Verification and Validation of Sy...Software and Systems Engineering Standards: Verification and Validation of Sy...
Software and Systems Engineering Standards: Verification and Validation of Sy...VICTOR MAESTRE RAMIREZ
 
Gfe Mayur Vihar Call Girls Service WhatsApp -> 9999965857 Available 24x7 ^ De...
Gfe Mayur Vihar Call Girls Service WhatsApp -> 9999965857 Available 24x7 ^ De...Gfe Mayur Vihar Call Girls Service WhatsApp -> 9999965857 Available 24x7 ^ De...
Gfe Mayur Vihar Call Girls Service WhatsApp -> 9999965857 Available 24x7 ^ De...srsj9000
 
An experimental study in using natural admixture as an alternative for chemic...
An experimental study in using natural admixture as an alternative for chemic...An experimental study in using natural admixture as an alternative for chemic...
An experimental study in using natural admixture as an alternative for chemic...Chandu841456
 
Oxy acetylene welding presentation note.
Oxy acetylene welding presentation note.Oxy acetylene welding presentation note.
Oxy acetylene welding presentation note.eptoze12
 
Introduction to Machine Learning Unit-3 for II MECH
Introduction to Machine Learning Unit-3 for II MECHIntroduction to Machine Learning Unit-3 for II MECH
Introduction to Machine Learning Unit-3 for II MECHC Sai Kiran
 
pipeline in computer architecture design
pipeline in computer architecture  designpipeline in computer architecture  design
pipeline in computer architecture designssuser87fa0c1
 
Study on Air-Water & Water-Water Heat Exchange in a Finned Tube Exchanger
Study on Air-Water & Water-Water Heat Exchange in a Finned Tube ExchangerStudy on Air-Water & Water-Water Heat Exchange in a Finned Tube Exchanger
Study on Air-Water & Water-Water Heat Exchange in a Finned Tube ExchangerAnamika Sarkar
 
UNIT III ANALOG ELECTRONICS (BASIC ELECTRONICS)
UNIT III ANALOG ELECTRONICS (BASIC ELECTRONICS)UNIT III ANALOG ELECTRONICS (BASIC ELECTRONICS)
UNIT III ANALOG ELECTRONICS (BASIC ELECTRONICS)Dr SOUNDIRARAJ N
 
Biology for Computer Engineers Course Handout.pptx
Biology for Computer Engineers Course Handout.pptxBiology for Computer Engineers Course Handout.pptx
Biology for Computer Engineers Course Handout.pptxDeepakSakkari2
 

Recently uploaded (20)

Electronically Controlled suspensions system .pdf
Electronically Controlled suspensions system .pdfElectronically Controlled suspensions system .pdf
Electronically Controlled suspensions system .pdf
 
Call Us ≽ 8377877756 ≼ Call Girls In Shastri Nagar (Delhi)
Call Us ≽ 8377877756 ≼ Call Girls In Shastri Nagar (Delhi)Call Us ≽ 8377877756 ≼ Call Girls In Shastri Nagar (Delhi)
Call Us ≽ 8377877756 ≼ Call Girls In Shastri Nagar (Delhi)
 
Work Experience-Dalton Park.pptxfvvvvvvv
Work Experience-Dalton Park.pptxfvvvvvvvWork Experience-Dalton Park.pptxfvvvvvvv
Work Experience-Dalton Park.pptxfvvvvvvv
 
CCS355 Neural Network & Deep Learning UNIT III notes and Question bank .pdf
CCS355 Neural Network & Deep Learning UNIT III notes and Question bank .pdfCCS355 Neural Network & Deep Learning UNIT III notes and Question bank .pdf
CCS355 Neural Network & Deep Learning UNIT III notes and Question bank .pdf
 
Internship report on mechanical engineering
Internship report on mechanical engineeringInternship report on mechanical engineering
Internship report on mechanical engineering
 
young call girls in Green Park🔝 9953056974 🔝 escort Service
young call girls in Green Park🔝 9953056974 🔝 escort Serviceyoung call girls in Green Park🔝 9953056974 🔝 escort Service
young call girls in Green Park🔝 9953056974 🔝 escort Service
 
main PPT.pptx of girls hostel security using rfid
main PPT.pptx of girls hostel security using rfidmain PPT.pptx of girls hostel security using rfid
main PPT.pptx of girls hostel security using rfid
 
Call Us -/9953056974- Call Girls In Vikaspuri-/- Delhi NCR
Call Us -/9953056974- Call Girls In Vikaspuri-/- Delhi NCRCall Us -/9953056974- Call Girls In Vikaspuri-/- Delhi NCR
Call Us -/9953056974- Call Girls In Vikaspuri-/- Delhi NCR
 
complete construction, environmental and economics information of biomass com...
complete construction, environmental and economics information of biomass com...complete construction, environmental and economics information of biomass com...
complete construction, environmental and economics information of biomass com...
 
Software and Systems Engineering Standards: Verification and Validation of Sy...
Software and Systems Engineering Standards: Verification and Validation of Sy...Software and Systems Engineering Standards: Verification and Validation of Sy...
Software and Systems Engineering Standards: Verification and Validation of Sy...
 
Gfe Mayur Vihar Call Girls Service WhatsApp -> 9999965857 Available 24x7 ^ De...
Gfe Mayur Vihar Call Girls Service WhatsApp -> 9999965857 Available 24x7 ^ De...Gfe Mayur Vihar Call Girls Service WhatsApp -> 9999965857 Available 24x7 ^ De...
Gfe Mayur Vihar Call Girls Service WhatsApp -> 9999965857 Available 24x7 ^ De...
 
An experimental study in using natural admixture as an alternative for chemic...
An experimental study in using natural admixture as an alternative for chemic...An experimental study in using natural admixture as an alternative for chemic...
An experimental study in using natural admixture as an alternative for chemic...
 
Oxy acetylene welding presentation note.
Oxy acetylene welding presentation note.Oxy acetylene welding presentation note.
Oxy acetylene welding presentation note.
 
Introduction to Machine Learning Unit-3 for II MECH
Introduction to Machine Learning Unit-3 for II MECHIntroduction to Machine Learning Unit-3 for II MECH
Introduction to Machine Learning Unit-3 for II MECH
 
pipeline in computer architecture design
pipeline in computer architecture  designpipeline in computer architecture  design
pipeline in computer architecture design
 
Study on Air-Water & Water-Water Heat Exchange in a Finned Tube Exchanger
Study on Air-Water & Water-Water Heat Exchange in a Finned Tube ExchangerStudy on Air-Water & Water-Water Heat Exchange in a Finned Tube Exchanger
Study on Air-Water & Water-Water Heat Exchange in a Finned Tube Exchanger
 
Design and analysis of solar grass cutter.pdf
Design and analysis of solar grass cutter.pdfDesign and analysis of solar grass cutter.pdf
Design and analysis of solar grass cutter.pdf
 
UNIT III ANALOG ELECTRONICS (BASIC ELECTRONICS)
UNIT III ANALOG ELECTRONICS (BASIC ELECTRONICS)UNIT III ANALOG ELECTRONICS (BASIC ELECTRONICS)
UNIT III ANALOG ELECTRONICS (BASIC ELECTRONICS)
 
Biology for Computer Engineers Course Handout.pptx
Biology for Computer Engineers Course Handout.pptxBiology for Computer Engineers Course Handout.pptx
Biology for Computer Engineers Course Handout.pptx
 
9953056974 Call Girls In South Ex, Escorts (Delhi) NCR.pdf
9953056974 Call Girls In South Ex, Escorts (Delhi) NCR.pdf9953056974 Call Girls In South Ex, Escorts (Delhi) NCR.pdf
9953056974 Call Girls In South Ex, Escorts (Delhi) NCR.pdf
 

R1-intro-to-go.pptx

  • 1. A Short Intro to Go CS 240 – Fall 2018 Rec. 1
  • 2. Some Housekeeping • Make sure you are on Piazza • Come to OH if you can’t install Go • Start Assignment 1 • Let us know on the Piazza poll if this recitation is too basic or advanced Basic Advanced
  • 3. You’re not a Business Major Stop Saving File Versions Like this:
  • 4. You’re a CS Major – Use Git COMMAND WHAT IT DOES git init Start recording changes in this directory git add Include this file in the next snapshot git commit Take a snapshot (commit) git reset Go back to the last snapshot (commit) git checkout a Go to snapshot a Resources to Learn Git: https://try.github.io/ Course website (Assignments): http://web.kaust.edu.sa/Faculty/MarcoCanini/classes/CS240/F18/assignm ents.html DEMO?
  • 5. “Go is a compiled, concurrent, statically typed, garbage-collected language developed at Google” - Rob Pike, 2012 What’s this Weird Language I’ve Never Heard of? Rob Pike is the Jeff Dean of distributed systems. Here’s the article the quote is from: https://talks.golang.org/2012/splash.article
  • 6. compiled Like C, C++ concurrent Like Erlang statically typed Like C, C++, Java garbage-collected Like Java and Python What’s this Weird Language I’ve Never Heard of?
  • 7. Why Not Use Python, Java, C++, etc? Built for Systems. Go preserves efficiency but has good abstractions. Easy multi threading and IO communication. Develop quickly Do many things efficiently and at the same time
  • 8. Official Self Reported List of Companies that use Go: https://github.com/golang/go/wiki/GoUsers Seems Google Specific. Who Else Actually Uses it?
  • 9. Why did they Choose Go? “We built everything in Python because it was easy, but now it’s slow. So we switched to Go.” - Most companies using Go
  • 10. But How do I Use Go? Start here: https://tour.golang.org/list Didn’t install Go? Use the web IDE: https://play.golang.org/ Other Resources: Go for Pythonists https://talks.golang.org/2013/go4python.slide#1 Go for Distributed Systems https://talks.golang.org/2013/distsys.slide#1 Official Go Talks https://github.com/golang/go/wiki/GoTalks
  • 11. But How do I Use Go? DEMO
  • 12. What About Object in Go? DEMO
  • 13.
  • 14. Build Software for Any System go build file.go Compile an executable for your machine env GOOS=windows GOARCH=amd64 go build file.go Compile an executable for Windows with 64 bit processor DEMO?
  • 15. Format your Code COMMAND WHAT IT DOES go fmt file.go Format the file.go properly DEMO
  • 16. Wait, I Have Questions! Go’s official “Frequently Asked Questions (FAQ)” https://golang.org/doc/faq
  • 17. Some Advice for the Assignments • Write modular code • Use comments (even to yourself) • Don’t forget go fmt (graded) • The clearer your code is, the more we can help with bugs