SlideShare a Scribd company logo
Golang
Getting to know Go
A short introduction
By Saray Chak, Web Developer
What is Go?
Go is a compiled, concurrent, garbage-collected, and statically
typed programming language developed at Goolge by Robert
Griesemer, Rob Pike, and Ken Thompson.
Golang
History
- 2007, started and built by Robert Griesemer, Rob Pike and Ken
Thompson as a part-time project.
- 2008, a lot of others people help to bring go from prototype to
reality
- 2009, go become a public Open Source project.
- 2010, starts to have adoption by other programmers
Why Go?
- Eliminate slowness
- Eliminate clumsiness
- Improve productivity
Who are using Go?
What will you see in Go?
- Simple syntax
- Compiled
- Garbage-collected
- Great standard library
- Statically and stronger typed
- Concurrent (goroutines)
- Multiple return values
- Go approach (Object Oriented without inheritance)
- Pointers
- Testing
- And so on...
What will you don’t see in Go?
- Exception handling
- Inheritance
- Method overloading
Go is a tool
Go is a tool for managing Go source code.
- build - compile packages and dependencies
- run - compile and run Go program
- clean - remove object files
- env - print Go environment information
- test - test packages and benchmarks
- Others : fix, fmt, get, install, list, version, vet.
Compiles
go build helloworld.go -> helloworld.exe
Packages
- Each Go program are compound per packages
- Program starts from main package
Variable
- The var instruction declares a
list of variables
- The type is informed at the end
- Inside a function, the short form
:= can be used instead of a var
declaration
Functions
Functions could have zero or more arguments
Multiple return values
A function can have multiple return values
Looping For and Forever
- Go has for as looping structure and it is very similar with C or
Java code, except for ()
- for can run forever
If Condition
- It is very similar with C or Java code, except for ()
What more?
- Switch
- Struct
- Map
- Slice
- Interface
- Pointer
- Receiver function
- Range
- Error
- And a lot more
A web server
It is simple to build a web server in Go
Concurrency (goroutines)
- Every concurrently executing activity in Go is known as Goroutine.
- A gorountine is a lightweight thread managed by Go
- To send or receive information between the goroutines, use
channels
Goroutine
Create more thread using keyword “go”
Channels
Channel is the only way to communicate with goroutine
Garbage collection
Go provides automatic garbage collection of allocated memory. It is
not necessary to release memory explicitly. There is no need to
worry about heap-allocated vs. stack-allocated storage.
Conclusion
- Go is a really nice language. It is easy to write and read.
- Go is a really fast, because it is compiled to machine code.
- Go has a well written standard libraries.
- Go supports multithreading and concurrency.
- Go provides automatic garbage collection of allocated memory.
- Go comes with built-in testing tool
- Go is quite young, so it still developing
- Go has no OOP approach
References
- https://github.com/golang/go/wiki/GoForCPPProgrammers
- https://golang.org/
- https://pkg.go.dev/std
Question?

More Related Content

PDF
Go language presentation
PPTX
Introduction to go lang
PDF
GoLang Introduction
PDF
Introduction to kotlin
ZIP
Robot Framework Introduction
PPTX
Go Programming language, golang
PDF
Golang 101
Go language presentation
Introduction to go lang
GoLang Introduction
Introduction to kotlin
Robot Framework Introduction
Go Programming language, golang
Golang 101

What's hot (20)

PDF
Introduction to Vagrant
PPTX
Jenkins CI
PPTX
Why Docker
PDF
Introduction to Go programming language
PPTX
Introduction to GoLang
PDF
Golang
PPTX
Angularjs PPT
PPTX
Go Language presentation
PPTX
Introduction to Node.js
PDF
Go Programming Language by Google
PPTX
Node js introduction
PDF
Why you should care about Go (Golang)
PDF
Introduction to Go language
PDF
Nodejs vatsal shah
PDF
Asynchronous JavaScript Programming
PPTX
20080311 - Paris Vi Master STL TA - Initiation Maven
PPTX
Golang (Go Programming Language)
PPTX
Bitbucket
PDF
[@NaukriEngineering] Messaging Queues
Introduction to Vagrant
Jenkins CI
Why Docker
Introduction to Go programming language
Introduction to GoLang
Golang
Angularjs PPT
Go Language presentation
Introduction to Node.js
Go Programming Language by Google
Node js introduction
Why you should care about Go (Golang)
Introduction to Go language
Nodejs vatsal shah
Asynchronous JavaScript Programming
20080311 - Paris Vi Master STL TA - Initiation Maven
Golang (Go Programming Language)
Bitbucket
[@NaukriEngineering] Messaging Queues
Ad

Similar to Golang (20)

PPT
A First Look at Google's Go Programming Language
PPT
Google's Go Programming Language - Introduction
PPTX
Scaling applications with go
PDF
Getting started with go - Florin Patan - Codemotion Milan 2016
PDF
Introduction to Go
PDF
Go After 4 Years in Production - QCon 2015
PPTX
Go fundamentals
PDF
The Go programming language - Intro by MyLittleAdventure
PPT
Introduction to Go ProgrammingLanguage.ppt
PDF
The Go programming language - Intro by MyLittleAdventure
PPTX
Golang workshop - Mindbowser
PDF
Golang : A Hype or the Future?
PDF
Golang nuts (by Nii Nai at DevCongress 2013)
PPTX
go language- haseeb.pptx
PDF
Why Go Lang?
PDF
Beyond the Hype: 4 Years of Go in Production
PDF
What would your own version of Ruby look like? (RubyKaigi)
PDF
Golang, Future of Programming Language.
PDF
iTHome Gopher Day 2017: What can Golang do? (Using project 52 as examples)
PDF
Getting started with Go - Florin Patan - Codemotion Rome 2017
A First Look at Google's Go Programming Language
Google's Go Programming Language - Introduction
Scaling applications with go
Getting started with go - Florin Patan - Codemotion Milan 2016
Introduction to Go
Go After 4 Years in Production - QCon 2015
Go fundamentals
The Go programming language - Intro by MyLittleAdventure
Introduction to Go ProgrammingLanguage.ppt
The Go programming language - Intro by MyLittleAdventure
Golang workshop - Mindbowser
Golang : A Hype or the Future?
Golang nuts (by Nii Nai at DevCongress 2013)
go language- haseeb.pptx
Why Go Lang?
Beyond the Hype: 4 Years of Go in Production
What would your own version of Ruby look like? (RubyKaigi)
Golang, Future of Programming Language.
iTHome Gopher Day 2017: What can Golang do? (Using project 52 as examples)
Getting started with Go - Florin Patan - Codemotion Rome 2017
Ad

Recently uploaded (20)

PPTX
Effective Security Operations Center (SOC) A Modern, Strategic, and Threat-In...
PDF
Modernizing your data center with Dell and AMD
PDF
Mobile App Security Testing_ A Comprehensive Guide.pdf
PDF
Bridging biosciences and deep learning for revolutionary discoveries: a compr...
PDF
TokAI - TikTok AI Agent : The First AI Application That Analyzes 10,000+ Vira...
PPTX
Cloud computing and distributed systems.
PDF
How UI/UX Design Impacts User Retention in Mobile Apps.pdf
PDF
Unlocking AI with Model Context Protocol (MCP)
PDF
Agricultural_Statistics_at_a_Glance_2022_0.pdf
PDF
Advanced methodologies resolving dimensionality complications for autism neur...
PPTX
Detection-First SIEM: Rule Types, Dashboards, and Threat-Informed Strategy
PDF
Blue Purple Modern Animated Computer Science Presentation.pdf.pdf
PDF
Encapsulation theory and applications.pdf
PDF
cuic standard and advanced reporting.pdf
PDF
Per capita expenditure prediction using model stacking based on satellite ima...
PDF
Reach Out and Touch Someone: Haptics and Empathic Computing
PDF
Building Integrated photovoltaic BIPV_UPV.pdf
PDF
Machine learning based COVID-19 study performance prediction
PDF
Encapsulation_ Review paper, used for researhc scholars
PDF
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf
Effective Security Operations Center (SOC) A Modern, Strategic, and Threat-In...
Modernizing your data center with Dell and AMD
Mobile App Security Testing_ A Comprehensive Guide.pdf
Bridging biosciences and deep learning for revolutionary discoveries: a compr...
TokAI - TikTok AI Agent : The First AI Application That Analyzes 10,000+ Vira...
Cloud computing and distributed systems.
How UI/UX Design Impacts User Retention in Mobile Apps.pdf
Unlocking AI with Model Context Protocol (MCP)
Agricultural_Statistics_at_a_Glance_2022_0.pdf
Advanced methodologies resolving dimensionality complications for autism neur...
Detection-First SIEM: Rule Types, Dashboards, and Threat-Informed Strategy
Blue Purple Modern Animated Computer Science Presentation.pdf.pdf
Encapsulation theory and applications.pdf
cuic standard and advanced reporting.pdf
Per capita expenditure prediction using model stacking based on satellite ima...
Reach Out and Touch Someone: Haptics and Empathic Computing
Building Integrated photovoltaic BIPV_UPV.pdf
Machine learning based COVID-19 study performance prediction
Encapsulation_ Review paper, used for researhc scholars
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf

Golang

  • 2. Getting to know Go A short introduction By Saray Chak, Web Developer
  • 3. What is Go? Go is a compiled, concurrent, garbage-collected, and statically typed programming language developed at Goolge by Robert Griesemer, Rob Pike, and Ken Thompson.
  • 5. History - 2007, started and built by Robert Griesemer, Rob Pike and Ken Thompson as a part-time project. - 2008, a lot of others people help to bring go from prototype to reality - 2009, go become a public Open Source project. - 2010, starts to have adoption by other programmers
  • 6. Why Go? - Eliminate slowness - Eliminate clumsiness - Improve productivity
  • 8. What will you see in Go? - Simple syntax - Compiled - Garbage-collected - Great standard library - Statically and stronger typed - Concurrent (goroutines) - Multiple return values - Go approach (Object Oriented without inheritance) - Pointers - Testing - And so on...
  • 9. What will you don’t see in Go? - Exception handling - Inheritance - Method overloading
  • 10. Go is a tool Go is a tool for managing Go source code. - build - compile packages and dependencies - run - compile and run Go program - clean - remove object files - env - print Go environment information - test - test packages and benchmarks - Others : fix, fmt, get, install, list, version, vet.
  • 11. Compiles go build helloworld.go -> helloworld.exe
  • 12. Packages - Each Go program are compound per packages - Program starts from main package
  • 13. Variable - The var instruction declares a list of variables - The type is informed at the end - Inside a function, the short form := can be used instead of a var declaration
  • 14. Functions Functions could have zero or more arguments
  • 15. Multiple return values A function can have multiple return values
  • 16. Looping For and Forever - Go has for as looping structure and it is very similar with C or Java code, except for () - for can run forever
  • 17. If Condition - It is very similar with C or Java code, except for ()
  • 18. What more? - Switch - Struct - Map - Slice - Interface - Pointer - Receiver function - Range - Error - And a lot more
  • 19. A web server It is simple to build a web server in Go
  • 20. Concurrency (goroutines) - Every concurrently executing activity in Go is known as Goroutine. - A gorountine is a lightweight thread managed by Go - To send or receive information between the goroutines, use channels
  • 21. Goroutine Create more thread using keyword “go”
  • 22. Channels Channel is the only way to communicate with goroutine
  • 23. Garbage collection Go provides automatic garbage collection of allocated memory. It is not necessary to release memory explicitly. There is no need to worry about heap-allocated vs. stack-allocated storage.
  • 24. Conclusion - Go is a really nice language. It is easy to write and read. - Go is a really fast, because it is compiled to machine code. - Go has a well written standard libraries. - Go supports multithreading and concurrency. - Go provides automatic garbage collection of allocated memory. - Go comes with built-in testing tool - Go is quite young, so it still developing - Go has no OOP approach