SlideShare a Scribd company logo
Golang Developer
 Go is a new programming language.
 Fast compilation times
 Statically-Typed Language
 Non-Object Oriented But ...
 Security
 Open Source
 Concurrent
 Simple
 Efficient and Productive
 powerful
 Design Start in 2007
 Released in 2009
 Designed and Support By GoogleCompany
 Designers: Robert Griesemer, Rob Pike, KenThompson
 Version 1.0 release in March 2012
 Development continues with an active community ...
 Web applications
 Server
 Command-line tools
 Games
 Scientific computing
 And etc....
 C language : Basic Syntax , Simple Structor
 Java : Inheritance via interface , Package Definitions
 C# language : Package Definitions
 JavaScript : Polymorphism Independent of Inheritance
 A combination of the above languages Is formed Go Programming
Language
 Google
 Iron.io
 Sound Cloud
 Canonical
 Heroku
 Carbon Games
 SmugMug
 Bitly
 Cloud
 Faster than PHP,Python, Perl,Node.js, Ruby,...
 A bit slower thanC, C++ and Java (sometimes faster than Java)
 SeeThis Link For Comparison:
 http://www.techempower.com/benchmarks/
 ...
 Linux
 BSD, OpenBSD
 Windows
 Mac OS
 Plan 9
 i386
 amd64
 arm
 IntelliJ
 SublimeText 2
 LiteIDE
 Intype
 NetBeans
 Eclipse
 Zeus
 and etc ...
 go command [arguments]
 Commands:
 build compile packages and dependencies
 clean remove object files
 doc run godoc on package sources
 fix run go tool fix on packages
 fmt run gofmt on package sources
 get download and install packages and dependencies
 install compile and install packages and dependencies
 list list packages
 run compile and run Go program
 test test packages
 vet run go tool vet on packages
 Example:
 go run hello.go
 package main
 import "fmt"
 func main() {
 fmt.Println("GolangTutorial")
 }
 Packages consists of one or more source file - lib (.go)
 package main
 Each SourceFile starts with a package
 package main
 import "fmt"
 func main() {
 fmt.Println("Golang Tutorial")
 }
 Import decleration is used to express a dependency on another package:
 import "fmt“
 packages are imported
 package main
 import "fmt"
 func main() {
 fmt.Println("Golang Tutorial")
 }
 OneLine:
 package main
 import "fmt"
 // this is a comment
 func main() {
 fmt.Println("HelloWorld")
 }
 MultiLine:
 package main
 import "fmt"
 /* this is a comment
 this is a multiline
 */
 func main() {
 fmt.Println("HelloWorld")
 }
 int
 bool
 string
 int int8 int16 int32 int64
 uint uint8 uint16 uint32 uint64 uintptr
 byte
 rune
 float32 float64
 complex64 complex128
 Type Conversion in Golang Is different
 package main
 import "fmt"
 func main(){
 var x float64 = 10.5
 var y int = int(x)
 fmt.Println(y)
 }
 Variables can store values
 var i int
 var f float64 = 1.5
 var b bool = true
 var s string = "golang"
 Shortcut :
 i := 10
 s := "Go-lang.ir"
 f := 1.5
 b := false
 Constants are declared like variables, but with the const keyword.
Constants can be character, string, boolean, or numeric values.
 package main
 import "fmt"
 const Pi = 3.14
 func main() {
 const World = "golang"
 fmt.Println("Hello",World)
 fmt.Println("Pi is:", Pi)
 const Check = true
 fmt.Println("Check ?", Check)
 }
 MultiValue in Array
 var list = […]int{1,2,3,4,5 }
 var list = [5]int{ 1,2,3,4,5 }
 list := […]int{1,2,3,4,5 }
 list := [5]int{ 1,2,3,4,5 }
 package main
 import "fmt"
 func main() {
 var a [2]string
 a[0] = "Hello"
 a[1] = "World"
 fmt.Println(a[0], a[1])
 fmt.Println(a)
 }
 A slice points to an array of values and also includes a length
 var list = []int{ 1, 2, 3 }
 var list = []string{ "foo", "bar", "zoo" }
 list := []int{ 1, 2, 3 }
 list := []string{ "foo", "bar", "zoo" }
 package main
 import "fmt"
 func main() {
 p := []int{2, 3, 5, 7, 11, 13}
 fmt.Println("p ==", p)
 for i := 0; i < len(p); i++ {
 fmt.Printf("p[%d] == %dn", i, p[i])
 }
 }
 M := map[string]string {}
 package main
 import "fmt"
 func main(){
 M := map[string]string {
 "x":"golang.org",
 "y":"go-lang.ir",
 }
 fmt.Println(M["x"],M["y"])
 }
 var M map[string]string
 M = make(map[string]string)
 package main
 import "fmt"
 var M map[string]string
 func main(){
 M := make(map[string]string)
 M = map[string]string {
 "x":"golang.org",
 "y":"go-lang.ir",
 }
 fmt.Println(M["x"],M["y"])
 }
 package main
 import "fmt"
 func main(){
 var a int = 2
 var b *int = &a
 a = 10
 fmt.Println(a, *b)
 }
 struct is a collection of fields
 typeTeacher struct {
 Name string
 Family string
 Tell string
 }
 package main
 import "fmt"
 typeTeacher struct {
 Name string
 Family string
 Tell string
 }
 func main() {
 T :=Teacher{Name: "Erfan", Family: "Akbarimanesh" ,Tell : "0571"}
 fmt.Println(T.Name,T.Family,T.Tell)
 }
 type Num int
 type Str string
 type MapType map[string]int
 package main
 import "fmt"
 type MapType map[string]int
 func main(){
 M := make(MapType)
 M = MapType {
 "x":10,
 "y":20,
 }
 fmt.Println(M["x"],M["y"])
 }

 package main
 import "fmt"
 func add(x int, y int) int {
 return x * y
 }
 func main() {
 fmt.Println(add(10, 2))
 }

 package main
 import "fmt"
 func Print_Value(x, y string) (string, string) {
 return y, x
 }
 func main() {
 a, b := Print_Value("golang", ".org")
 fmt.Println(a, b)
 }
Erfan Akbarimanesh
Golang Developer
 My Profile:
 Click Here
 Person Email:
 Mr.Akbarimanesh@gmail.com
 Work EMail:
 info@go-lang.ir
 Golang English:
 golang.org
 Golang Persian:
 go-lang.ir
 Package Documentation:
 golang.org/pkg
 Golang Document:
 golang.org/doc
Thank you

More Related Content

PDF
Go Lang Tutorial
Wei-Ning Huang
 
PDF
Introduction to Go programming language
Slawomir Dorzak
 
PPTX
Go Programming Language (Golang)
Ishin Vin
 
PDF
Golang and Eco-System Introduction / Overview
Markus Schneider
 
PPTX
Go Language Hands-on Workshop Material
Romin Irani
 
PDF
FTD JVM Internals
Felipe Mamud
 
PDF
Introduction to go language programming
Mahmoud Masih Tehrani
 
PPTX
EuroPython 2016 - Do I Need To Switch To Golang
Max Tepkeev
 
Go Lang Tutorial
Wei-Ning Huang
 
Introduction to Go programming language
Slawomir Dorzak
 
Go Programming Language (Golang)
Ishin Vin
 
Golang and Eco-System Introduction / Overview
Markus Schneider
 
Go Language Hands-on Workshop Material
Romin Irani
 
FTD JVM Internals
Felipe Mamud
 
Introduction to go language programming
Mahmoud Masih Tehrani
 
EuroPython 2016 - Do I Need To Switch To Golang
Max Tepkeev
 

What's hot (20)

PPTX
Go. Why it goes
Sergey Pichkurov
 
PDF
Introduction to Programming in Go
Amr Hassan
 
ODP
Hands on Session on Python
Sumit Raj
 
PDF
Happy Go Programming Part 1
Lin Yo-An
 
ODP
OpenGurukul : Language : Python
Open Gurukul
 
PDF
Happy Go Programming
Lin Yo-An
 
PDF
ECSE 221 - Introduction to Computer Engineering - Tutorial 1 - Muhammad Ehtas...
Muhammad Ulhaque
 
KEY
Beauty and Power of Go
Frank Müller
 
ODP
An Intro to Python in 30 minutes
Sumit Raj
 
PPTX
PYTHON -Chapter 2 - Functions, Exception, Modules and Files -MAULIK BOR...
Maulik Borsaniya
 
PDF
Fantom - Programming Language for JVM, CLR, and Javascript
Kamil Toman
 
PDF
Free Monads Getting Started
Kent Ohashi
 
PPTX
The GO Language : From Beginners to Gophers
I.I.S. G. Vallauri - Fossano
 
PDF
Introduction to Clime
Mosky Liu
 
ODP
OpenGurukul : Language : C++ Programming
Open Gurukul
 
PDF
MP in Clojure
Kent Ohashi
 
PDF
Programming with Python - Adv.
Mosky Liu
 
PPTX
Python in 30 minutes!
Fariz Darari
 
PDF
PyCon 2013 : Scripting to PyPi to GitHub and More
Matt Harrison
 
PPTX
Hacking Go Compiler Internals / GoCon 2014 Autumn
Moriyoshi Koizumi
 
Go. Why it goes
Sergey Pichkurov
 
Introduction to Programming in Go
Amr Hassan
 
Hands on Session on Python
Sumit Raj
 
Happy Go Programming Part 1
Lin Yo-An
 
OpenGurukul : Language : Python
Open Gurukul
 
Happy Go Programming
Lin Yo-An
 
ECSE 221 - Introduction to Computer Engineering - Tutorial 1 - Muhammad Ehtas...
Muhammad Ulhaque
 
Beauty and Power of Go
Frank Müller
 
An Intro to Python in 30 minutes
Sumit Raj
 
PYTHON -Chapter 2 - Functions, Exception, Modules and Files -MAULIK BOR...
Maulik Borsaniya
 
Fantom - Programming Language for JVM, CLR, and Javascript
Kamil Toman
 
Free Monads Getting Started
Kent Ohashi
 
The GO Language : From Beginners to Gophers
I.I.S. G. Vallauri - Fossano
 
Introduction to Clime
Mosky Liu
 
OpenGurukul : Language : C++ Programming
Open Gurukul
 
MP in Clojure
Kent Ohashi
 
Programming with Python - Adv.
Mosky Liu
 
Python in 30 minutes!
Fariz Darari
 
PyCon 2013 : Scripting to PyPi to GitHub and More
Matt Harrison
 
Hacking Go Compiler Internals / GoCon 2014 Autumn
Moriyoshi Koizumi
 
Ad

Viewers also liked (8)

PDF
Golang #5: To Go or not to Go
Oliver N
 
PDF
Socket Programming In Python
didip
 
PDF
Golang
Felipe Mamud
 
PDF
Programming with Python and PostgreSQL
Peter Eisentraut
 
PDF
Programming with Python - Basic
Mosky Liu
 
PPTX
Write microservice in golang
Bo-Yi Wu
 
PDF
Develop Android app using Golang
SeongJae Park
 
PDF
Functional programming in Python
Colin Su
 
Golang #5: To Go or not to Go
Oliver N
 
Socket Programming In Python
didip
 
Golang
Felipe Mamud
 
Programming with Python and PostgreSQL
Peter Eisentraut
 
Programming with Python - Basic
Mosky Liu
 
Write microservice in golang
Bo-Yi Wu
 
Develop Android app using Golang
SeongJae Park
 
Functional programming in Python
Colin Su
 
Ad

Similar to Golang iran - tutorial go programming language - Preliminary (20)

PPTX
Golang basics for Java developers - Part 1
Robert Stern
 
PDF
Go serving: Building server app with go
Hean Hong Leong
 
PDF
Let's golang
SuHyun Jeon
 
PDF
10〜30分で何となく分かるGo
Moriyoshi Koizumi
 
PPTX
Go programming introduction
Ginto Joseph
 
PDF
Coding in GO - GDG SL - NSBM
Raveen Perera
 
PPTX
Introduction to Go
Lorenzo Aiello
 
PPTX
Lab2_AdvancedGoConceptswithgo_foundationofgolang_.pptx
stasneemattia
 
PDF
Geeks Anonymes - Le langage Go
Geeks Anonymes
 
PDF
Golang 101
宇 傅
 
PDF
Introduction to Go for Java Programmers
Kalpa Pathum Welivitigoda
 
PDF
Something about Golang
Anton Arhipov
 
PDF
Golang workshop
Victor S. Recio
 
PDF
Trivadis TechEvent 2016 Go - The Cloud Programming Language by Andija Sisko
Trivadis
 
PDF
Hello Go
Eleanor McHugh
 
PDF
A Tour of Go - Workshop
Rodolfo Carvalho
 
PDF
Python GTK (Hacking Camp)
Yuren Ju
 
PDF
Python-GTK
Yuren Ju
 
PDF
Go introduction
Anna Goławska
 
PDF
Learning go for perl programmers
Fred Moyer
 
Golang basics for Java developers - Part 1
Robert Stern
 
Go serving: Building server app with go
Hean Hong Leong
 
Let's golang
SuHyun Jeon
 
10〜30分で何となく分かるGo
Moriyoshi Koizumi
 
Go programming introduction
Ginto Joseph
 
Coding in GO - GDG SL - NSBM
Raveen Perera
 
Introduction to Go
Lorenzo Aiello
 
Lab2_AdvancedGoConceptswithgo_foundationofgolang_.pptx
stasneemattia
 
Geeks Anonymes - Le langage Go
Geeks Anonymes
 
Golang 101
宇 傅
 
Introduction to Go for Java Programmers
Kalpa Pathum Welivitigoda
 
Something about Golang
Anton Arhipov
 
Golang workshop
Victor S. Recio
 
Trivadis TechEvent 2016 Go - The Cloud Programming Language by Andija Sisko
Trivadis
 
Hello Go
Eleanor McHugh
 
A Tour of Go - Workshop
Rodolfo Carvalho
 
Python GTK (Hacking Camp)
Yuren Ju
 
Python-GTK
Yuren Ju
 
Go introduction
Anna Goławska
 
Learning go for perl programmers
Fred Moyer
 

Recently uploaded (20)

PDF
The Picture of Dorian Gray summary and depiction
opaliyahemel
 
PPTX
Information Texts_Infographic on Forgetting Curve.pptx
Tata Sevilla
 
PPTX
TEF & EA Bsc Nursing 5th sem.....BBBpptx
AneetaSharma15
 
PDF
Review of Related Literature & Studies.pdf
Thelma Villaflores
 
PDF
UTS Health Student Promotional Representative_Position Description.pdf
Faculty of Health, University of Technology Sydney
 
PPTX
How to Manage Leads in Odoo 18 CRM - Odoo Slides
Celine George
 
PDF
Sunset Boulevard Student Revision Booklet
jpinnuck
 
PPTX
PREVENTIVE PEDIATRIC. pptx
AneetaSharma15
 
PPT
Python Programming Unit II Control Statements.ppt
CUO VEERANAN VEERANAN
 
PPTX
PPTs-The Rise of Empiresghhhhhhhh (1).pptx
academysrusti114
 
PPTX
An introduction to Prepositions for beginners.pptx
drsiddhantnagine
 
PPTX
HISTORY COLLECTION FOR PSYCHIATRIC PATIENTS.pptx
PoojaSen20
 
DOCX
SAROCES Action-Plan FOR ARAL PROGRAM IN DEPED
Levenmartlacuna1
 
PPTX
FSSAI (Food Safety and Standards Authority of India) & FDA (Food and Drug Adm...
Dr. Paindla Jyothirmai
 
PDF
The Minister of Tourism, Culture and Creative Arts, Abla Dzifa Gomashie has e...
nservice241
 
PPTX
An introduction to Dialogue writing.pptx
drsiddhantnagine
 
PDF
What is CFA?? Complete Guide to the Chartered Financial Analyst Program
sp4989653
 
PPTX
Care of patients with elImination deviation.pptx
AneetaSharma15
 
PDF
Antianginal agents, Definition, Classification, MOA.pdf
Prerana Jadhav
 
PPTX
Dakar Framework Education For All- 2000(Act)
santoshmohalik1
 
The Picture of Dorian Gray summary and depiction
opaliyahemel
 
Information Texts_Infographic on Forgetting Curve.pptx
Tata Sevilla
 
TEF & EA Bsc Nursing 5th sem.....BBBpptx
AneetaSharma15
 
Review of Related Literature & Studies.pdf
Thelma Villaflores
 
UTS Health Student Promotional Representative_Position Description.pdf
Faculty of Health, University of Technology Sydney
 
How to Manage Leads in Odoo 18 CRM - Odoo Slides
Celine George
 
Sunset Boulevard Student Revision Booklet
jpinnuck
 
PREVENTIVE PEDIATRIC. pptx
AneetaSharma15
 
Python Programming Unit II Control Statements.ppt
CUO VEERANAN VEERANAN
 
PPTs-The Rise of Empiresghhhhhhhh (1).pptx
academysrusti114
 
An introduction to Prepositions for beginners.pptx
drsiddhantnagine
 
HISTORY COLLECTION FOR PSYCHIATRIC PATIENTS.pptx
PoojaSen20
 
SAROCES Action-Plan FOR ARAL PROGRAM IN DEPED
Levenmartlacuna1
 
FSSAI (Food Safety and Standards Authority of India) & FDA (Food and Drug Adm...
Dr. Paindla Jyothirmai
 
The Minister of Tourism, Culture and Creative Arts, Abla Dzifa Gomashie has e...
nservice241
 
An introduction to Dialogue writing.pptx
drsiddhantnagine
 
What is CFA?? Complete Guide to the Chartered Financial Analyst Program
sp4989653
 
Care of patients with elImination deviation.pptx
AneetaSharma15
 
Antianginal agents, Definition, Classification, MOA.pdf
Prerana Jadhav
 
Dakar Framework Education For All- 2000(Act)
santoshmohalik1
 

Golang iran - tutorial go programming language - Preliminary

  • 2.  Go is a new programming language.  Fast compilation times  Statically-Typed Language  Non-Object Oriented But ...  Security  Open Source  Concurrent  Simple  Efficient and Productive  powerful
  • 3.  Design Start in 2007  Released in 2009  Designed and Support By GoogleCompany  Designers: Robert Griesemer, Rob Pike, KenThompson  Version 1.0 release in March 2012  Development continues with an active community ...
  • 4.  Web applications  Server  Command-line tools  Games  Scientific computing  And etc....
  • 5.  C language : Basic Syntax , Simple Structor  Java : Inheritance via interface , Package Definitions  C# language : Package Definitions  JavaScript : Polymorphism Independent of Inheritance  A combination of the above languages Is formed Go Programming Language
  • 6.  Google  Iron.io  Sound Cloud  Canonical  Heroku  Carbon Games  SmugMug  Bitly  Cloud
  • 7.  Faster than PHP,Python, Perl,Node.js, Ruby,...  A bit slower thanC, C++ and Java (sometimes faster than Java)  SeeThis Link For Comparison:  http://www.techempower.com/benchmarks/  ...
  • 8.  Linux  BSD, OpenBSD  Windows  Mac OS  Plan 9
  • 10.  IntelliJ  SublimeText 2  LiteIDE  Intype  NetBeans  Eclipse  Zeus  and etc ...
  • 11.  go command [arguments]  Commands:  build compile packages and dependencies  clean remove object files  doc run godoc on package sources  fix run go tool fix on packages  fmt run gofmt on package sources  get download and install packages and dependencies  install compile and install packages and dependencies  list list packages  run compile and run Go program  test test packages  vet run go tool vet on packages  Example:  go run hello.go
  • 12.  package main  import "fmt"  func main() {  fmt.Println("GolangTutorial")  }
  • 13.  Packages consists of one or more source file - lib (.go)  package main  Each SourceFile starts with a package  package main  import "fmt"  func main() {  fmt.Println("Golang Tutorial")  }
  • 14.  Import decleration is used to express a dependency on another package:  import "fmt“  packages are imported  package main  import "fmt"  func main() {  fmt.Println("Golang Tutorial")  }
  • 15.  OneLine:  package main  import "fmt"  // this is a comment  func main() {  fmt.Println("HelloWorld")  }  MultiLine:  package main  import "fmt"  /* this is a comment  this is a multiline  */  func main() {  fmt.Println("HelloWorld")  }
  • 16.  int  bool  string  int int8 int16 int32 int64  uint uint8 uint16 uint32 uint64 uintptr  byte  rune  float32 float64  complex64 complex128
  • 17.  Type Conversion in Golang Is different  package main  import "fmt"  func main(){  var x float64 = 10.5  var y int = int(x)  fmt.Println(y)  }
  • 18.  Variables can store values  var i int  var f float64 = 1.5  var b bool = true  var s string = "golang"  Shortcut :  i := 10  s := "Go-lang.ir"  f := 1.5  b := false
  • 19.  Constants are declared like variables, but with the const keyword. Constants can be character, string, boolean, or numeric values.  package main  import "fmt"  const Pi = 3.14  func main() {  const World = "golang"  fmt.Println("Hello",World)  fmt.Println("Pi is:", Pi)  const Check = true  fmt.Println("Check ?", Check)  }
  • 20.  MultiValue in Array  var list = […]int{1,2,3,4,5 }  var list = [5]int{ 1,2,3,4,5 }  list := […]int{1,2,3,4,5 }  list := [5]int{ 1,2,3,4,5 }  package main  import "fmt"  func main() {  var a [2]string  a[0] = "Hello"  a[1] = "World"  fmt.Println(a[0], a[1])  fmt.Println(a)  }
  • 21.  A slice points to an array of values and also includes a length  var list = []int{ 1, 2, 3 }  var list = []string{ "foo", "bar", "zoo" }  list := []int{ 1, 2, 3 }  list := []string{ "foo", "bar", "zoo" }  package main  import "fmt"  func main() {  p := []int{2, 3, 5, 7, 11, 13}  fmt.Println("p ==", p)  for i := 0; i < len(p); i++ {  fmt.Printf("p[%d] == %dn", i, p[i])  }  }
  • 22.  M := map[string]string {}  package main  import "fmt"  func main(){  M := map[string]string {  "x":"golang.org",  "y":"go-lang.ir",  }  fmt.Println(M["x"],M["y"])  }
  • 23.  var M map[string]string  M = make(map[string]string)  package main  import "fmt"  var M map[string]string  func main(){  M := make(map[string]string)  M = map[string]string {  "x":"golang.org",  "y":"go-lang.ir",  }  fmt.Println(M["x"],M["y"])  }
  • 24.  package main  import "fmt"  func main(){  var a int = 2  var b *int = &a  a = 10  fmt.Println(a, *b)  }
  • 25.  struct is a collection of fields  typeTeacher struct {  Name string  Family string  Tell string  }  package main  import "fmt"  typeTeacher struct {  Name string  Family string  Tell string  }  func main() {  T :=Teacher{Name: "Erfan", Family: "Akbarimanesh" ,Tell : "0571"}  fmt.Println(T.Name,T.Family,T.Tell)  }
  • 26.  type Num int  type Str string  type MapType map[string]int  package main  import "fmt"  type MapType map[string]int  func main(){  M := make(MapType)  M = MapType {  "x":10,  "y":20,  }  fmt.Println(M["x"],M["y"])  } 
  • 27.  package main  import "fmt"  func add(x int, y int) int {  return x * y  }  func main() {  fmt.Println(add(10, 2))  } 
  • 28.  package main  import "fmt"  func Print_Value(x, y string) (string, string) {  return y, x  }  func main() {  a, b := Print_Value("golang", ".org")  fmt.Println(a, b)  }
  • 29. Erfan Akbarimanesh Golang Developer  My Profile:  Click Here  Person Email:  [email protected]  Work EMail:  [email protected]
  • 30.  Golang English:  golang.org  Golang Persian:  go-lang.ir  Package Documentation:  golang.org/pkg  Golang Document:  golang.org/doc Thank you