SlideShare a Scribd company logo
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 GitHub
Scott Graham
 
Write microservice in golang
Write microservice in golangWrite microservice in golang
Write microservice in golang
Bo-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 Source
Prachitibhukan
 
Github for Serious Business Professional
Github for Serious Business ProfessionalGithub for Serious Business Professional
Github for Serious Business Professional
zwheller
 
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
 
An Introduction to Go
An Introduction to GoAn Introduction to Go
An Introduction to Go
Imesh Gunaratne
 
Introduction to git & github
Introduction to git & githubIntroduction to git & github
Introduction to git & github
Vinothini KadambavanaSundaram
 
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
GDSCKNUST
 
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
Codemotion
 
Untangling fall2017 week2_try2
Untangling fall2017 week2_try2Untangling fall2017 week2_try2
Untangling fall2017 week2_try2
Derek Jacoby
 
Untangling fall2017 week2
Untangling fall2017 week2Untangling fall2017 week2
Untangling fall2017 week2
Derek 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 go
Vimlesh Sharma
 
GIT from n00b
GIT from n00bGIT from n00b
GIT from n00b
Supachai Vorrasing
 
Introduction to go
Introduction to goIntroduction to go
Introduction to go
Anthony Chow
 
GitLab webcast - Release 8.4
GitLab webcast - Release 8.4GitLab webcast - Release 8.4
GitLab webcast - Release 8.4
GitLab, Inc
 
Git single branch
Git single branchGit single branch
Git single branch
Carl Brown
 
Workflows using Git GitHub | Edureka
Workflows using Git GitHub | EdurekaWorkflows using Git GitHub | Edureka
Workflows using Git GitHub | Edureka
Edureka!
 
Best practices-for-production-environments
Best practices-for-production-environmentsBest practices-for-production-environments
Best practices-for-production-environments
Artem Kovardin
 
Intro. to Git and Github
Intro. to Git and GithubIntro. to Git and Github
Intro. to Git and Github
Olmo F. Maldonado
 

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

Unit-III-ELECTROCHEMICAL STORAGE DEVICES.ppt
Unit-III-ELECTROCHEMICAL STORAGE DEVICES.pptUnit-III-ELECTROCHEMICAL STORAGE DEVICES.ppt
Unit-III-ELECTROCHEMICAL STORAGE DEVICES.ppt
KrishnaveniKrishnara1
 
Rainfall intensity duration frequency curve statistical analysis and modeling...
Rainfall intensity duration frequency curve statistical analysis and modeling...Rainfall intensity duration frequency curve statistical analysis and modeling...
Rainfall intensity duration frequency curve statistical analysis and modeling...
bijceesjournal
 
Generative AI leverages algorithms to create various forms of content
Generative AI leverages algorithms to create various forms of contentGenerative AI leverages algorithms to create various forms of content
Generative AI leverages algorithms to create various forms of content
Hitesh Mohapatra
 
Welding Metallurgy Ferrous Materials.pdf
Welding Metallurgy Ferrous Materials.pdfWelding Metallurgy Ferrous Materials.pdf
Welding Metallurgy Ferrous Materials.pdf
AjmalKhan50578
 
原版制作(Humboldt毕业证书)柏林大学毕业证学位证一模一样
原版制作(Humboldt毕业证书)柏林大学毕业证学位证一模一样原版制作(Humboldt毕业证书)柏林大学毕业证学位证一模一样
原版制作(Humboldt毕业证书)柏林大学毕业证学位证一模一样
ydzowc
 
Curve Fitting in Numerical Methods Regression
Curve Fitting in Numerical Methods RegressionCurve Fitting in Numerical Methods Regression
Curve Fitting in Numerical Methods Regression
Nada Hikmah
 
ITSM Integration with MuleSoft.pptx
ITSM  Integration with MuleSoft.pptxITSM  Integration with MuleSoft.pptx
ITSM Integration with MuleSoft.pptx
VANDANAMOHANGOUDA
 
artificial intelligence and data science contents.pptx
artificial intelligence and data science contents.pptxartificial intelligence and data science contents.pptx
artificial intelligence and data science contents.pptx
GauravCar
 
Applications of artificial Intelligence in Mechanical Engineering.pdf
Applications of artificial Intelligence in Mechanical Engineering.pdfApplications of artificial Intelligence in Mechanical Engineering.pdf
Applications of artificial Intelligence in Mechanical Engineering.pdf
Atif Razi
 
An improved modulation technique suitable for a three level flying capacitor ...
An improved modulation technique suitable for a three level flying capacitor ...An improved modulation technique suitable for a three level flying capacitor ...
An improved modulation technique suitable for a three level flying capacitor ...
IJECEIAES
 
cnn.pptx Convolutional neural network used for image classication
cnn.pptx Convolutional neural network used for image classicationcnn.pptx Convolutional neural network used for image classication
cnn.pptx Convolutional neural network used for image classication
SakkaravarthiShanmug
 
An Introduction to the Compiler Designss
An Introduction to the Compiler DesignssAn Introduction to the Compiler Designss
An Introduction to the Compiler Designss
ElakkiaU
 
Redefining brain tumor segmentation: a cutting-edge convolutional neural netw...
Redefining brain tumor segmentation: a cutting-edge convolutional neural netw...Redefining brain tumor segmentation: a cutting-edge convolutional neural netw...
Redefining brain tumor segmentation: a cutting-edge convolutional neural netw...
IJECEIAES
 
spirit beverages ppt without graphics.pptx
spirit beverages ppt without graphics.pptxspirit beverages ppt without graphics.pptx
spirit beverages ppt without graphics.pptx
Madan Karki
 
CompEx~Manual~1210 (2).pdf COMPEX GAS AND VAPOURS
CompEx~Manual~1210 (2).pdf COMPEX GAS AND VAPOURSCompEx~Manual~1210 (2).pdf COMPEX GAS AND VAPOURS
CompEx~Manual~1210 (2).pdf COMPEX GAS AND VAPOURS
RamonNovais6
 
Material for memory and display system h
Material for memory and display system hMaterial for memory and display system h
Material for memory and display system h
gowrishankartb2005
 
132/33KV substation case study Presentation
132/33KV substation case study Presentation132/33KV substation case study Presentation
132/33KV substation case study Presentation
kandramariana6
 
Software Engineering and Project Management - Introduction, Modeling Concepts...
Software Engineering and Project Management - Introduction, Modeling Concepts...Software Engineering and Project Management - Introduction, Modeling Concepts...
Software Engineering and Project Management - Introduction, Modeling Concepts...
Prakhyath Rai
 
Software Quality Assurance-se412-v11.ppt
Software Quality Assurance-se412-v11.pptSoftware Quality Assurance-se412-v11.ppt
Software Quality Assurance-se412-v11.ppt
TaghreedAltamimi
 
一比一原版(CalArts毕业证)加利福尼亚艺术学院毕业证如何办理
一比一原版(CalArts毕业证)加利福尼亚艺术学院毕业证如何办理一比一原版(CalArts毕业证)加利福尼亚艺术学院毕业证如何办理
一比一原版(CalArts毕业证)加利福尼亚艺术学院毕业证如何办理
ecqow
 

Recently uploaded (20)

Unit-III-ELECTROCHEMICAL STORAGE DEVICES.ppt
Unit-III-ELECTROCHEMICAL STORAGE DEVICES.pptUnit-III-ELECTROCHEMICAL STORAGE DEVICES.ppt
Unit-III-ELECTROCHEMICAL STORAGE DEVICES.ppt
 
Rainfall intensity duration frequency curve statistical analysis and modeling...
Rainfall intensity duration frequency curve statistical analysis and modeling...Rainfall intensity duration frequency curve statistical analysis and modeling...
Rainfall intensity duration frequency curve statistical analysis and modeling...
 
Generative AI leverages algorithms to create various forms of content
Generative AI leverages algorithms to create various forms of contentGenerative AI leverages algorithms to create various forms of content
Generative AI leverages algorithms to create various forms of content
 
Welding Metallurgy Ferrous Materials.pdf
Welding Metallurgy Ferrous Materials.pdfWelding Metallurgy Ferrous Materials.pdf
Welding Metallurgy Ferrous Materials.pdf
 
原版制作(Humboldt毕业证书)柏林大学毕业证学位证一模一样
原版制作(Humboldt毕业证书)柏林大学毕业证学位证一模一样原版制作(Humboldt毕业证书)柏林大学毕业证学位证一模一样
原版制作(Humboldt毕业证书)柏林大学毕业证学位证一模一样
 
Curve Fitting in Numerical Methods Regression
Curve Fitting in Numerical Methods RegressionCurve Fitting in Numerical Methods Regression
Curve Fitting in Numerical Methods Regression
 
ITSM Integration with MuleSoft.pptx
ITSM  Integration with MuleSoft.pptxITSM  Integration with MuleSoft.pptx
ITSM Integration with MuleSoft.pptx
 
artificial intelligence and data science contents.pptx
artificial intelligence and data science contents.pptxartificial intelligence and data science contents.pptx
artificial intelligence and data science contents.pptx
 
Applications of artificial Intelligence in Mechanical Engineering.pdf
Applications of artificial Intelligence in Mechanical Engineering.pdfApplications of artificial Intelligence in Mechanical Engineering.pdf
Applications of artificial Intelligence in Mechanical Engineering.pdf
 
An improved modulation technique suitable for a three level flying capacitor ...
An improved modulation technique suitable for a three level flying capacitor ...An improved modulation technique suitable for a three level flying capacitor ...
An improved modulation technique suitable for a three level flying capacitor ...
 
cnn.pptx Convolutional neural network used for image classication
cnn.pptx Convolutional neural network used for image classicationcnn.pptx Convolutional neural network used for image classication
cnn.pptx Convolutional neural network used for image classication
 
An Introduction to the Compiler Designss
An Introduction to the Compiler DesignssAn Introduction to the Compiler Designss
An Introduction to the Compiler Designss
 
Redefining brain tumor segmentation: a cutting-edge convolutional neural netw...
Redefining brain tumor segmentation: a cutting-edge convolutional neural netw...Redefining brain tumor segmentation: a cutting-edge convolutional neural netw...
Redefining brain tumor segmentation: a cutting-edge convolutional neural netw...
 
spirit beverages ppt without graphics.pptx
spirit beverages ppt without graphics.pptxspirit beverages ppt without graphics.pptx
spirit beverages ppt without graphics.pptx
 
CompEx~Manual~1210 (2).pdf COMPEX GAS AND VAPOURS
CompEx~Manual~1210 (2).pdf COMPEX GAS AND VAPOURSCompEx~Manual~1210 (2).pdf COMPEX GAS AND VAPOURS
CompEx~Manual~1210 (2).pdf COMPEX GAS AND VAPOURS
 
Material for memory and display system h
Material for memory and display system hMaterial for memory and display system h
Material for memory and display system h
 
132/33KV substation case study Presentation
132/33KV substation case study Presentation132/33KV substation case study Presentation
132/33KV substation case study Presentation
 
Software Engineering and Project Management - Introduction, Modeling Concepts...
Software Engineering and Project Management - Introduction, Modeling Concepts...Software Engineering and Project Management - Introduction, Modeling Concepts...
Software Engineering and Project Management - Introduction, Modeling Concepts...
 
Software Quality Assurance-se412-v11.ppt
Software Quality Assurance-se412-v11.pptSoftware Quality Assurance-se412-v11.ppt
Software Quality Assurance-se412-v11.ppt
 
一比一原版(CalArts毕业证)加利福尼亚艺术学院毕业证如何办理
一比一原版(CalArts毕业证)加利福尼亚艺术学院毕业证如何办理一比一原版(CalArts毕业证)加利福尼亚艺术学院毕业证如何办理
一比一原版(CalArts毕业证)加利福尼亚艺术学院毕业证如何办理
 

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