SlideShare a Scribd company logo
The Go
Programming
Language
By İbrahim Kürce
Quoted from John Sonmez
Three chapters: Go Overview, Go Development and Variables, Types, Pointers
1 – Go Overview – What is Go?
 Compiled
 Garbage-collected
 Concurrent
Compiled
 Code adapted to machine that they’re running on
 Compiled down to machine languages like C, C++
 More efficient and better performance than interpreted languages
 Supported operating systems: Linux, Mac OS
X, FreeBSD, OpenBSD, Plan 9, Windows
 Supported processors: i386, amd64, ARM
Garbage-collected
 You do not have to manage memory as programmer, unlike C, C++
 Runtime handles for you
 Garbage collection is very fast, latency free
Concurrent
 Concurrency is to do more than one thing at a time
 Programming languages like C++ and Java, concurrency is possible but hard to
manage. It is not part of language
 Go has built in concurrency support
 It is called Go Routines for concurrent functions
Go’s Origins
 Three Google engineers want a system level languages for aging systems level
languages
 Go was designed very fast compiling language
Sept 2007
Dream of Go
March 2012
Go 1
released
May 2010
Used
internally at
Google
Nov 2009
Officially
announced
What makes Go different?
 Efficient like a static language, ease of use like dynamic language
 Type-safe and memory-safe
 Latency free garbage collection
 Fast compile times
 It does not have assertions and method overloading
2 – Go Development - Packages
 Way to modularize code
 Similar to namespaces
 Collection of types and functions
 Can import packages in your code
 Redistribute those packages
 A lot of built-in packages, https://golang.org/pkg/
Imports
Code.go
Source code
Local packages
Remote packages
Imports
 Go knows whether your code needs those packages
 Has ability to go out and get remote packages
 Your code could refer to github etc. repositories
Hello World
package main Required package name "main"
import "fmt" Package comes with Go
func main(){ Curly braces is near by function name
fmt.Println("Hello World")
}
Println start with upper case, cause it is exported method
Hello World
 Direct run, not generate .exe file
go run hello.go
 To Build to generate .exe file
go build hello.go
 To run after build
hello.exe
3 – Variables, Types and Pointers
 Basic Types
 bool
 string
 int, int8, int16, int32, int64
 uint, uint8, uint16, uint32, uint64, uintptr
 byte(unit8)
 rune(int32), like a char
 float32, float64
 complex64, complex128
Types
 Other types
 Array
 Slice
 Struct
 Pointer
 Function
 Interface
 Map
 Channel
Basic Declaration
Multi-Declaration and Initialization
Multi-Declaration and Initialization
 Default value is 0 for int types
 Default value is always set in Go language
Without Types Without var
Multi-Declaration and Initialization
 Do not need to have same type in multi-declaration
Pointer Basics
 Pointer is a type of variable that is going to contain a memory address of another
variable
 string pointer has same type with string type
Hello
World
0xc042
00a270
Pointer Basics, Passing Things
 Pointer’s type is that type is going to refer to what type of variable
 We pass value in Go function, this value will be copied, inside function, we change
this value, originial value is not changed
function
43
43
function
43
45
Passing Things
 If we pass a pointer to function, pointer also will be copied but it points same
memory location. So if we change value inside function, originial value will also be
changed
function
43
0x0123
0x0123
Basic Pointer Example
 greeting is a pointer, if we write it directly, it shows memory address
 If we write *greeting, it shows Hello world
Pointer Assignment
 If we change value of pointer, we also change originial value
No Classes in Go
 Go is not object-oriented language
 Instead of using classes in Go, we use what’s called user define types
 For example;
Basic User Types
 Salutation struct definition
Constants
 In Go, you can define constants without defining the type
 PI is numeric, Language is string type
 A, B, C = 0, 1, 2 respectively
End of Go Overview, Go Development and
Variables, Types, Pointers

More Related Content

What's hot (20)

PDF
C++ Object oriented concepts & programming
nirajmandaliya
 
PPT
Introduction to-programming
BG Java EE Course
 
PPTX
Structure of java program diff c- cpp and java
Madishetty Prathibha
 
PPTX
Full Python in 20 slides
rfojdar
 
DOC
C#
LiquidHub
 
PPTX
OCA Java SE 8 Exam Chapter 3 Core Java APIs
İbrahim Kürce
 
PPTX
Programming Fundamentals With OOPs Concepts (Java Examples Based)
indiangarg
 
DOCX
Java Interview Questions For Freshers
zynofustechnology
 
ODP
OOP java
xball977
 
PPTX
Effective Java - Chapter 3: Methods Common to All Objects
İbrahim Kürce
 
PPT
Unit 1 Java
arnold 7490
 
PDF
Object-oriented Programming in Python
Juan-Manuel Gimeno
 
PPTX
Comparable/ Comparator
Sean McElrath
 
PPTX
Abstract class and Interface
Haris Bin Zahid
 
PDF
Java beans
Ravi Kant Sahu
 
PPSX
Comparable and comparator – a detailed discussion
Dharmendra Prasad
 
PPT
Java interfaces & abstract classes
Shreyans Pathak
 
PPTX
OCA Java SE 8 Exam Chapter 6 Exceptions
İbrahim Kürce
 
PPT
Ap Power Point Chpt7
dplunkett
 
DOCX
C# interview quesions
Shashwat Shriparv
 
C++ Object oriented concepts & programming
nirajmandaliya
 
Introduction to-programming
BG Java EE Course
 
Structure of java program diff c- cpp and java
Madishetty Prathibha
 
Full Python in 20 slides
rfojdar
 
OCA Java SE 8 Exam Chapter 3 Core Java APIs
İbrahim Kürce
 
Programming Fundamentals With OOPs Concepts (Java Examples Based)
indiangarg
 
Java Interview Questions For Freshers
zynofustechnology
 
OOP java
xball977
 
Effective Java - Chapter 3: Methods Common to All Objects
İbrahim Kürce
 
Unit 1 Java
arnold 7490
 
Object-oriented Programming in Python
Juan-Manuel Gimeno
 
Comparable/ Comparator
Sean McElrath
 
Abstract class and Interface
Haris Bin Zahid
 
Java beans
Ravi Kant Sahu
 
Comparable and comparator – a detailed discussion
Dharmendra Prasad
 
Java interfaces & abstract classes
Shreyans Pathak
 
OCA Java SE 8 Exam Chapter 6 Exceptions
İbrahim Kürce
 
Ap Power Point Chpt7
dplunkett
 
C# interview quesions
Shashwat Shriparv
 

Viewers also liked (8)

PPTX
Effective Java - Chapter 2: Creating and Destroying Objects
İbrahim Kürce
 
PPT
Effective Java - Generics
Roshan Deniyage
 
PPT
Effective Java - Enum and Annotations
Roshan Deniyage
 
PDF
Effective java 1 and 2
중선 곽
 
PPTX
Effective Java - Chapter 4: Classes and Interfaces
İbrahim Kürce
 
PPTX
Effective Java
Brice Argenson
 
PPTX
Effective java
Emprovise
 
PDF
Effective java
Haeil Yi
 
Effective Java - Chapter 2: Creating and Destroying Objects
İbrahim Kürce
 
Effective Java - Generics
Roshan Deniyage
 
Effective Java - Enum and Annotations
Roshan Deniyage
 
Effective java 1 and 2
중선 곽
 
Effective Java - Chapter 4: Classes and Interfaces
İbrahim Kürce
 
Effective Java
Brice Argenson
 
Effective java
Emprovise
 
Effective java
Haeil Yi
 
Ad

Similar to The Go Programing Language 1 (20)

PDF
The GO programming language
Marco Sabatini
 
PPTX
Golang - Overview of Go (golang) Language
Aniruddha Chakrabarti
 
PPTX
Should i Go there
Shimi Bandiel
 
PPTX
Lab1GoBasicswithgo_foundationofgolang.pptx
stasneemattia
 
PDF
Golang
Felipe Mamud
 
PPTX
Golang introduction
DineshDinesh131
 
PPT
Introduction to Go ProgrammingLanguage.ppt
PedroAlexandre215482
 
PDF
Introduction to Programming in Go
Amr Hassan
 
PPTX
Golang workshop - Mindbowser
Mindbowser Inc
 
PPTX
Golang
Fatih Şimşek
 
PDF
Go introduction
Anna Goławska
 
PDF
Lecture 1 - Overview of Go Language 1.pdf
daomaithuhuyen1273
 
PPTX
Go Programming Language (Golang)
Ishin Vin
 
PDF
Golang and Eco-System Introduction / Overview
Markus Schneider
 
PPTX
Go Programming language, golang
Basil N G
 
ODP
Ready to go
Atin Mukherjee
 
PDF
Go lang
Suelen Carvalho
 
PPTX
Lab2_AdvancedGoConceptswithgo_foundationofgolang_.pptx
stasneemattia
 
PPTX
Introduction to go lang
Amal Mohan N
 
The GO programming language
Marco Sabatini
 
Golang - Overview of Go (golang) Language
Aniruddha Chakrabarti
 
Should i Go there
Shimi Bandiel
 
Lab1GoBasicswithgo_foundationofgolang.pptx
stasneemattia
 
Golang
Felipe Mamud
 
Golang introduction
DineshDinesh131
 
Introduction to Go ProgrammingLanguage.ppt
PedroAlexandre215482
 
Introduction to Programming in Go
Amr Hassan
 
Golang workshop - Mindbowser
Mindbowser Inc
 
Go introduction
Anna Goławska
 
Lecture 1 - Overview of Go Language 1.pdf
daomaithuhuyen1273
 
Go Programming Language (Golang)
Ishin Vin
 
Golang and Eco-System Introduction / Overview
Markus Schneider
 
Go Programming language, golang
Basil N G
 
Ready to go
Atin Mukherjee
 
Lab2_AdvancedGoConceptswithgo_foundationofgolang_.pptx
stasneemattia
 
Introduction to go lang
Amal Mohan N
 
Ad

Recently uploaded (20)

PDF
Streamline Contractor Lifecycle- TECH EHS Solution
TECH EHS Solution
 
PPTX
How Apagen Empowered an EPC Company with Engineering ERP Software
SatishKumar2651
 
PDF
HiHelloHR – Simplify HR Operations for Modern Workplaces
HiHelloHR
 
PDF
GetOnCRM Speeds Up Agentforce 3 Deployment for Enterprise AI Wins.pdf
GetOnCRM Solutions
 
PPTX
Migrating Millions of Users with Debezium, Apache Kafka, and an Acyclic Synch...
MD Sayem Ahmed
 
PDF
Automate Cybersecurity Tasks with Python
VICTOR MAESTRE RAMIREZ
 
PPTX
MiniTool Power Data Recovery Full Crack Latest 2025
muhammadgurbazkhan
 
PPTX
Platform for Enterprise Solution - Java EE5
abhishekoza1981
 
PDF
Mobile CMMS Solutions Empowering the Frontline Workforce
CryotosCMMSSoftware
 
PDF
Revenue streams of the Wazirx clone script.pdf
aaronjeffray
 
PPTX
Writing Better Code - Helping Developers make Decisions.pptx
Lorraine Steyn
 
PDF
Beyond Binaries: Understanding Diversity and Allyship in a Global Workplace -...
Imma Valls Bernaus
 
PPT
MergeSortfbsjbjsfk sdfik k
RafishaikIT02044
 
PPTX
Feb 2021 Cohesity first pitch presentation.pptx
enginsayin1
 
PDF
Digger Solo: Semantic search and maps for your local files
seanpedersen96
 
PPTX
The Role of a PHP Development Company in Modern Web Development
SEO Company for School in Delhi NCR
 
PDF
Build It, Buy It, or Already Got It? Make Smarter Martech Decisions
bbedford2
 
PPTX
Equipment Management Software BIS Safety UK.pptx
BIS Safety Software
 
PDF
Linux Certificate of Completion - LabEx Certificate
VICTOR MAESTRE RAMIREZ
 
PPTX
Why Businesses Are Switching to Open Source Alternatives to Crystal Reports.pptx
Varsha Nayak
 
Streamline Contractor Lifecycle- TECH EHS Solution
TECH EHS Solution
 
How Apagen Empowered an EPC Company with Engineering ERP Software
SatishKumar2651
 
HiHelloHR – Simplify HR Operations for Modern Workplaces
HiHelloHR
 
GetOnCRM Speeds Up Agentforce 3 Deployment for Enterprise AI Wins.pdf
GetOnCRM Solutions
 
Migrating Millions of Users with Debezium, Apache Kafka, and an Acyclic Synch...
MD Sayem Ahmed
 
Automate Cybersecurity Tasks with Python
VICTOR MAESTRE RAMIREZ
 
MiniTool Power Data Recovery Full Crack Latest 2025
muhammadgurbazkhan
 
Platform for Enterprise Solution - Java EE5
abhishekoza1981
 
Mobile CMMS Solutions Empowering the Frontline Workforce
CryotosCMMSSoftware
 
Revenue streams of the Wazirx clone script.pdf
aaronjeffray
 
Writing Better Code - Helping Developers make Decisions.pptx
Lorraine Steyn
 
Beyond Binaries: Understanding Diversity and Allyship in a Global Workplace -...
Imma Valls Bernaus
 
MergeSortfbsjbjsfk sdfik k
RafishaikIT02044
 
Feb 2021 Cohesity first pitch presentation.pptx
enginsayin1
 
Digger Solo: Semantic search and maps for your local files
seanpedersen96
 
The Role of a PHP Development Company in Modern Web Development
SEO Company for School in Delhi NCR
 
Build It, Buy It, or Already Got It? Make Smarter Martech Decisions
bbedford2
 
Equipment Management Software BIS Safety UK.pptx
BIS Safety Software
 
Linux Certificate of Completion - LabEx Certificate
VICTOR MAESTRE RAMIREZ
 
Why Businesses Are Switching to Open Source Alternatives to Crystal Reports.pptx
Varsha Nayak
 

The Go Programing Language 1

  • 1. The Go Programming Language By İbrahim Kürce Quoted from John Sonmez Three chapters: Go Overview, Go Development and Variables, Types, Pointers
  • 2. 1 – Go Overview – What is Go?  Compiled  Garbage-collected  Concurrent
  • 3. Compiled  Code adapted to machine that they’re running on  Compiled down to machine languages like C, C++  More efficient and better performance than interpreted languages  Supported operating systems: Linux, Mac OS X, FreeBSD, OpenBSD, Plan 9, Windows  Supported processors: i386, amd64, ARM
  • 4. Garbage-collected  You do not have to manage memory as programmer, unlike C, C++  Runtime handles for you  Garbage collection is very fast, latency free
  • 5. Concurrent  Concurrency is to do more than one thing at a time  Programming languages like C++ and Java, concurrency is possible but hard to manage. It is not part of language  Go has built in concurrency support  It is called Go Routines for concurrent functions
  • 6. Go’s Origins  Three Google engineers want a system level languages for aging systems level languages  Go was designed very fast compiling language Sept 2007 Dream of Go March 2012 Go 1 released May 2010 Used internally at Google Nov 2009 Officially announced
  • 7. What makes Go different?  Efficient like a static language, ease of use like dynamic language  Type-safe and memory-safe  Latency free garbage collection  Fast compile times  It does not have assertions and method overloading
  • 8. 2 – Go Development - Packages  Way to modularize code  Similar to namespaces  Collection of types and functions  Can import packages in your code  Redistribute those packages  A lot of built-in packages, https://golang.org/pkg/
  • 10. Imports  Go knows whether your code needs those packages  Has ability to go out and get remote packages  Your code could refer to github etc. repositories
  • 11. Hello World package main Required package name "main" import "fmt" Package comes with Go func main(){ Curly braces is near by function name fmt.Println("Hello World") } Println start with upper case, cause it is exported method
  • 12. Hello World  Direct run, not generate .exe file go run hello.go  To Build to generate .exe file go build hello.go  To run after build hello.exe
  • 13. 3 – Variables, Types and Pointers  Basic Types  bool  string  int, int8, int16, int32, int64  uint, uint8, uint16, uint32, uint64, uintptr  byte(unit8)  rune(int32), like a char  float32, float64  complex64, complex128
  • 14. Types  Other types  Array  Slice  Struct  Pointer  Function  Interface  Map  Channel
  • 17. Multi-Declaration and Initialization  Default value is 0 for int types  Default value is always set in Go language Without Types Without var
  • 18. Multi-Declaration and Initialization  Do not need to have same type in multi-declaration
  • 19. Pointer Basics  Pointer is a type of variable that is going to contain a memory address of another variable  string pointer has same type with string type Hello World 0xc042 00a270
  • 20. Pointer Basics, Passing Things  Pointer’s type is that type is going to refer to what type of variable  We pass value in Go function, this value will be copied, inside function, we change this value, originial value is not changed function 43 43 function 43 45
  • 21. Passing Things  If we pass a pointer to function, pointer also will be copied but it points same memory location. So if we change value inside function, originial value will also be changed function 43 0x0123 0x0123
  • 22. Basic Pointer Example  greeting is a pointer, if we write it directly, it shows memory address  If we write *greeting, it shows Hello world
  • 23. Pointer Assignment  If we change value of pointer, we also change originial value
  • 24. No Classes in Go  Go is not object-oriented language  Instead of using classes in Go, we use what’s called user define types  For example;
  • 25. Basic User Types  Salutation struct definition
  • 26. Constants  In Go, you can define constants without defining the type  PI is numeric, Language is string type  A, B, C = 0, 1, 2 respectively
  • 27. End of Go Overview, Go Development and Variables, Types, Pointers