SlideShare a Scribd company logo
1 of 30
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

What's hot

Introduction to Programming in Go
Introduction to Programming in GoIntroduction to Programming in Go
Introduction to Programming in GoAmr Hassan
 
Hands on Session on Python
Hands on Session on PythonHands on Session on Python
Hands on Session on PythonSumit Raj
 
Happy Go Programming Part 1
Happy Go Programming Part 1Happy Go Programming Part 1
Happy Go Programming Part 1Lin Yo-An
 
OpenGurukul : Language : Python
OpenGurukul : Language : PythonOpenGurukul : Language : Python
OpenGurukul : Language : PythonOpen Gurukul
 
Happy Go Programming
Happy Go ProgrammingHappy Go Programming
Happy Go ProgrammingLin Yo-An
 
ECSE 221 - Introduction to Computer Engineering - Tutorial 1 - Muhammad Ehtas...
ECSE 221 - Introduction to Computer Engineering - Tutorial 1 - Muhammad Ehtas...ECSE 221 - Introduction to Computer Engineering - Tutorial 1 - Muhammad Ehtas...
ECSE 221 - Introduction to Computer Engineering - Tutorial 1 - Muhammad Ehtas...Muhammad Ulhaque
 
Beauty and Power of Go
Beauty and Power of GoBeauty and Power of Go
Beauty and Power of GoFrank Müller
 
An Intro to Python in 30 minutes
An Intro to Python in 30 minutesAn Intro to Python in 30 minutes
An Intro to Python in 30 minutesSumit Raj
 
PYTHON -Chapter 2 - Functions, Exception, Modules and Files -MAULIK BOR...
PYTHON -Chapter 2 - Functions,   Exception, Modules  and    Files -MAULIK BOR...PYTHON -Chapter 2 - Functions,   Exception, Modules  and    Files -MAULIK BOR...
PYTHON -Chapter 2 - Functions, Exception, Modules and Files -MAULIK BOR...Maulik Borsaniya
 
Fantom - Programming Language for JVM, CLR, and Javascript
Fantom - Programming Language for JVM, CLR, and JavascriptFantom - Programming Language for JVM, CLR, and Javascript
Fantom - Programming Language for JVM, CLR, and JavascriptKamil Toman
 
Free Monads Getting Started
Free Monads Getting StartedFree Monads Getting Started
Free Monads Getting StartedKent Ohashi
 
The GO Language : From Beginners to Gophers
The GO Language : From Beginners to GophersThe GO Language : From Beginners to Gophers
The GO Language : From Beginners to GophersAlessandro Sanino
 
Introduction to Clime
Introduction to ClimeIntroduction to Clime
Introduction to ClimeMosky Liu
 
OpenGurukul : Language : C++ Programming
OpenGurukul : Language : C++ ProgrammingOpenGurukul : Language : C++ Programming
OpenGurukul : Language : C++ ProgrammingOpen Gurukul
 
Programming with Python - Adv.
Programming with Python - Adv.Programming with Python - Adv.
Programming with Python - Adv.Mosky Liu
 
Python in 30 minutes!
Python in 30 minutes!Python in 30 minutes!
Python in 30 minutes!Fariz Darari
 
PyCon 2013 : Scripting to PyPi to GitHub and More
PyCon 2013 : Scripting to PyPi to GitHub and MorePyCon 2013 : Scripting to PyPi to GitHub and More
PyCon 2013 : Scripting to PyPi to GitHub and MoreMatt Harrison
 
Hacking Go Compiler Internals / GoCon 2014 Autumn
Hacking Go Compiler Internals / GoCon 2014 AutumnHacking Go Compiler Internals / GoCon 2014 Autumn
Hacking Go Compiler Internals / GoCon 2014 AutumnMoriyoshi Koizumi
 

What's hot (20)

Go. Why it goes
Go. Why it goesGo. Why it goes
Go. Why it goes
 
Introduction to Programming in Go
Introduction to Programming in GoIntroduction to Programming in Go
Introduction to Programming in Go
 
Hands on Session on Python
Hands on Session on PythonHands on Session on Python
Hands on Session on Python
 
Happy Go Programming Part 1
Happy Go Programming Part 1Happy Go Programming Part 1
Happy Go Programming Part 1
 
OpenGurukul : Language : Python
OpenGurukul : Language : PythonOpenGurukul : Language : Python
OpenGurukul : Language : Python
 
Happy Go Programming
Happy Go ProgrammingHappy Go Programming
Happy Go Programming
 
ECSE 221 - Introduction to Computer Engineering - Tutorial 1 - Muhammad Ehtas...
ECSE 221 - Introduction to Computer Engineering - Tutorial 1 - Muhammad Ehtas...ECSE 221 - Introduction to Computer Engineering - Tutorial 1 - Muhammad Ehtas...
ECSE 221 - Introduction to Computer Engineering - Tutorial 1 - Muhammad Ehtas...
 
Beauty and Power of Go
Beauty and Power of GoBeauty and Power of Go
Beauty and Power of Go
 
An Intro to Python in 30 minutes
An Intro to Python in 30 minutesAn Intro to Python in 30 minutes
An Intro to Python in 30 minutes
 
PYTHON -Chapter 2 - Functions, Exception, Modules and Files -MAULIK BOR...
PYTHON -Chapter 2 - Functions,   Exception, Modules  and    Files -MAULIK BOR...PYTHON -Chapter 2 - Functions,   Exception, Modules  and    Files -MAULIK BOR...
PYTHON -Chapter 2 - Functions, Exception, Modules and Files -MAULIK BOR...
 
Fantom - Programming Language for JVM, CLR, and Javascript
Fantom - Programming Language for JVM, CLR, and JavascriptFantom - Programming Language for JVM, CLR, and Javascript
Fantom - Programming Language for JVM, CLR, and Javascript
 
Free Monads Getting Started
Free Monads Getting StartedFree Monads Getting Started
Free Monads Getting Started
 
The GO Language : From Beginners to Gophers
The GO Language : From Beginners to GophersThe GO Language : From Beginners to Gophers
The GO Language : From Beginners to Gophers
 
Introduction to Clime
Introduction to ClimeIntroduction to Clime
Introduction to Clime
 
OpenGurukul : Language : C++ Programming
OpenGurukul : Language : C++ ProgrammingOpenGurukul : Language : C++ Programming
OpenGurukul : Language : C++ Programming
 
MP in Clojure
MP in ClojureMP in Clojure
MP in Clojure
 
Programming with Python - Adv.
Programming with Python - Adv.Programming with Python - Adv.
Programming with Python - Adv.
 
Python in 30 minutes!
Python in 30 minutes!Python in 30 minutes!
Python in 30 minutes!
 
PyCon 2013 : Scripting to PyPi to GitHub and More
PyCon 2013 : Scripting to PyPi to GitHub and MorePyCon 2013 : Scripting to PyPi to GitHub and More
PyCon 2013 : Scripting to PyPi to GitHub and More
 
Hacking Go Compiler Internals / GoCon 2014 Autumn
Hacking Go Compiler Internals / GoCon 2014 AutumnHacking Go Compiler Internals / GoCon 2014 Autumn
Hacking Go Compiler Internals / GoCon 2014 Autumn
 

Viewers also liked

Golang #5: To Go or not to Go
Golang #5: To Go or not to GoGolang #5: To Go or not to Go
Golang #5: To Go or not to GoOliver N
 
Socket Programming In Python
Socket Programming In PythonSocket Programming In Python
Socket Programming In Pythondidip
 
Programming with Python and PostgreSQL
Programming with Python and PostgreSQLProgramming with Python and PostgreSQL
Programming with Python and PostgreSQLPeter Eisentraut
 
Programming with Python - Basic
Programming with Python - BasicProgramming with Python - Basic
Programming with Python - BasicMosky Liu
 
Write microservice in golang
Write microservice in golangWrite microservice in golang
Write microservice in golangBo-Yi Wu
 
Develop Android app using Golang
Develop Android app using GolangDevelop Android app using Golang
Develop Android app using GolangSeongJae Park
 
Functional programming in Python
Functional programming in PythonFunctional programming in Python
Functional programming in PythonColin Su
 

Viewers also liked (8)

Golang #5: To Go or not to Go
Golang #5: To Go or not to GoGolang #5: To Go or not to Go
Golang #5: To Go or not to Go
 
Socket Programming In Python
Socket Programming In PythonSocket Programming In Python
Socket Programming In Python
 
Golang
GolangGolang
Golang
 
Programming with Python and PostgreSQL
Programming with Python and PostgreSQLProgramming with Python and PostgreSQL
Programming with Python and PostgreSQL
 
Programming with Python - Basic
Programming with Python - BasicProgramming with Python - Basic
Programming with Python - Basic
 
Write microservice in golang
Write microservice in golangWrite microservice in golang
Write microservice in golang
 
Develop Android app using Golang
Develop Android app using GolangDevelop Android app using Golang
Develop Android app using Golang
 
Functional programming in Python
Functional programming in PythonFunctional programming in Python
Functional programming in Python
 

Similar to Golang iran - tutorial go programming language - Preliminary

Golang basics for Java developers - Part 1
Golang basics for Java developers - Part 1Golang basics for Java developers - Part 1
Golang basics for Java developers - Part 1Robert Stern
 
Go serving: Building server app with go
Go serving: Building server app with goGo serving: Building server app with go
Go serving: Building server app with goHean Hong Leong
 
10〜30分で何となく分かるGo
10〜30分で何となく分かるGo10〜30分で何となく分かるGo
10〜30分で何となく分かるGoMoriyoshi Koizumi
 
Go programming introduction
Go programming introductionGo programming introduction
Go programming introductionGinto Joseph
 
Coding in GO - GDG SL - NSBM
Coding in GO - GDG SL - NSBMCoding in GO - GDG SL - NSBM
Coding in GO - GDG SL - NSBMRaveen Perera
 
Geeks Anonymes - Le langage Go
Geeks Anonymes - Le langage GoGeeks Anonymes - Le langage Go
Geeks Anonymes - Le langage GoGeeks Anonymes
 
Golang 101
Golang 101Golang 101
Golang 101宇 傅
 
Something about Golang
Something about GolangSomething about Golang
Something about GolangAnton Arhipov
 
Trivadis TechEvent 2016 Go - The Cloud Programming Language by Andija Sisko
Trivadis TechEvent 2016 Go - The Cloud Programming Language by Andija SiskoTrivadis TechEvent 2016 Go - The Cloud Programming Language by Andija Sisko
Trivadis TechEvent 2016 Go - The Cloud Programming Language by Andija SiskoTrivadis
 
Python GTK (Hacking Camp)
Python GTK (Hacking Camp)Python GTK (Hacking Camp)
Python GTK (Hacking Camp)Yuren Ju
 
Python-GTK
Python-GTKPython-GTK
Python-GTKYuren Ju
 
Learning go for perl programmers
Learning go for perl programmersLearning go for perl programmers
Learning go for perl programmersFred Moyer
 
Go ahead, make my day
Go ahead, make my dayGo ahead, make my day
Go ahead, make my dayTor Ivry
 

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

Golang basics for Java developers - Part 1
Golang basics for Java developers - Part 1Golang basics for Java developers - Part 1
Golang basics for Java developers - Part 1
 
Go serving: Building server app with go
Go serving: Building server app with goGo serving: Building server app with go
Go serving: Building server app with go
 
Let's golang
Let's golangLet's golang
Let's golang
 
10〜30分で何となく分かるGo
10〜30分で何となく分かるGo10〜30分で何となく分かるGo
10〜30分で何となく分かるGo
 
Go programming introduction
Go programming introductionGo programming introduction
Go programming introduction
 
Coding in GO - GDG SL - NSBM
Coding in GO - GDG SL - NSBMCoding in GO - GDG SL - NSBM
Coding in GO - GDG SL - NSBM
 
Introduction to Go
Introduction to GoIntroduction to Go
Introduction to Go
 
Geeks Anonymes - Le langage Go
Geeks Anonymes - Le langage GoGeeks Anonymes - Le langage Go
Geeks Anonymes - Le langage Go
 
Golang 101
Golang 101Golang 101
Golang 101
 
Introduction to Go for Java Programmers
Introduction to Go for Java ProgrammersIntroduction to Go for Java Programmers
Introduction to Go for Java Programmers
 
Something about Golang
Something about GolangSomething about Golang
Something about Golang
 
Golang workshop
Golang workshopGolang workshop
Golang workshop
 
Trivadis TechEvent 2016 Go - The Cloud Programming Language by Andija Sisko
Trivadis TechEvent 2016 Go - The Cloud Programming Language by Andija SiskoTrivadis TechEvent 2016 Go - The Cloud Programming Language by Andija Sisko
Trivadis TechEvent 2016 Go - The Cloud Programming Language by Andija Sisko
 
Hello Go
Hello GoHello Go
Hello Go
 
A Tour of Go - Workshop
A Tour of Go - WorkshopA Tour of Go - Workshop
A Tour of Go - Workshop
 
Python GTK (Hacking Camp)
Python GTK (Hacking Camp)Python GTK (Hacking Camp)
Python GTK (Hacking Camp)
 
Python-GTK
Python-GTKPython-GTK
Python-GTK
 
Go introduction
Go   introductionGo   introduction
Go introduction
 
Learning go for perl programmers
Learning go for perl programmersLearning go for perl programmers
Learning go for perl programmers
 
Go ahead, make my day
Go ahead, make my dayGo ahead, make my day
Go ahead, make my day
 

Recently uploaded

BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdfBASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdfSoniaTolstoy
 
Accessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impactAccessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impactdawncurless
 
1029-Danh muc Sach Giao Khoa khoi 6.pdf
1029-Danh muc Sach Giao Khoa khoi  6.pdf1029-Danh muc Sach Giao Khoa khoi  6.pdf
1029-Danh muc Sach Giao Khoa khoi 6.pdfQucHHunhnh
 
The basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptxThe basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptxheathfieldcps1
 
Q4-W6-Restating Informational Text Grade 3
Q4-W6-Restating Informational Text Grade 3Q4-W6-Restating Informational Text Grade 3
Q4-W6-Restating Informational Text Grade 3JemimahLaneBuaron
 
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptxSOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptxiammrhaywood
 
A Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy ReformA Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy ReformChameera Dedduwage
 
Russian Call Girls in Andheri Airport Mumbai WhatsApp 9167673311 💞 Full Nigh...
Russian Call Girls in Andheri Airport Mumbai WhatsApp  9167673311 💞 Full Nigh...Russian Call Girls in Andheri Airport Mumbai WhatsApp  9167673311 💞 Full Nigh...
Russian Call Girls in Andheri Airport Mumbai WhatsApp 9167673311 💞 Full Nigh...Pooja Nehwal
 
APM Welcome, APM North West Network Conference, Synergies Across Sectors
APM Welcome, APM North West Network Conference, Synergies Across SectorsAPM Welcome, APM North West Network Conference, Synergies Across Sectors
APM Welcome, APM North West Network Conference, Synergies Across SectorsAssociation for Project Management
 
Activity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfActivity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfciinovamais
 
Web & Social Media Analytics Previous Year Question Paper.pdf
Web & Social Media Analytics Previous Year Question Paper.pdfWeb & Social Media Analytics Previous Year Question Paper.pdf
Web & Social Media Analytics Previous Year Question Paper.pdfJayanti Pande
 
microwave assisted reaction. General introduction
microwave assisted reaction. General introductionmicrowave assisted reaction. General introduction
microwave assisted reaction. General introductionMaksud Ahmed
 
Organic Name Reactions for the students and aspirants of Chemistry12th.pptx
Organic Name Reactions  for the students and aspirants of Chemistry12th.pptxOrganic Name Reactions  for the students and aspirants of Chemistry12th.pptx
Organic Name Reactions for the students and aspirants of Chemistry12th.pptxVS Mahajan Coaching Centre
 
Paris 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activityParis 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activityGeoBlogs
 
Sanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdfSanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdfsanyamsingh5019
 
Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111Sapana Sha
 
Sports & Fitness Value Added Course FY..
Sports & Fitness Value Added Course FY..Sports & Fitness Value Added Course FY..
Sports & Fitness Value Added Course FY..Disha Kariya
 
Beyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global ImpactBeyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global ImpactPECB
 

Recently uploaded (20)

BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdfBASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdf
 
Accessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impactAccessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impact
 
1029-Danh muc Sach Giao Khoa khoi 6.pdf
1029-Danh muc Sach Giao Khoa khoi  6.pdf1029-Danh muc Sach Giao Khoa khoi  6.pdf
1029-Danh muc Sach Giao Khoa khoi 6.pdf
 
The basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptxThe basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptx
 
Q4-W6-Restating Informational Text Grade 3
Q4-W6-Restating Informational Text Grade 3Q4-W6-Restating Informational Text Grade 3
Q4-W6-Restating Informational Text Grade 3
 
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptxSOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
 
A Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy ReformA Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy Reform
 
Russian Call Girls in Andheri Airport Mumbai WhatsApp 9167673311 💞 Full Nigh...
Russian Call Girls in Andheri Airport Mumbai WhatsApp  9167673311 💞 Full Nigh...Russian Call Girls in Andheri Airport Mumbai WhatsApp  9167673311 💞 Full Nigh...
Russian Call Girls in Andheri Airport Mumbai WhatsApp 9167673311 💞 Full Nigh...
 
APM Welcome, APM North West Network Conference, Synergies Across Sectors
APM Welcome, APM North West Network Conference, Synergies Across SectorsAPM Welcome, APM North West Network Conference, Synergies Across Sectors
APM Welcome, APM North West Network Conference, Synergies Across Sectors
 
Código Creativo y Arte de Software | Unidad 1
Código Creativo y Arte de Software | Unidad 1Código Creativo y Arte de Software | Unidad 1
Código Creativo y Arte de Software | Unidad 1
 
Activity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfActivity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdf
 
Web & Social Media Analytics Previous Year Question Paper.pdf
Web & Social Media Analytics Previous Year Question Paper.pdfWeb & Social Media Analytics Previous Year Question Paper.pdf
Web & Social Media Analytics Previous Year Question Paper.pdf
 
microwave assisted reaction. General introduction
microwave assisted reaction. General introductionmicrowave assisted reaction. General introduction
microwave assisted reaction. General introduction
 
Organic Name Reactions for the students and aspirants of Chemistry12th.pptx
Organic Name Reactions  for the students and aspirants of Chemistry12th.pptxOrganic Name Reactions  for the students and aspirants of Chemistry12th.pptx
Organic Name Reactions for the students and aspirants of Chemistry12th.pptx
 
Advance Mobile Application Development class 07
Advance Mobile Application Development class 07Advance Mobile Application Development class 07
Advance Mobile Application Development class 07
 
Paris 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activityParis 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activity
 
Sanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdfSanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdf
 
Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111
 
Sports & Fitness Value Added Course FY..
Sports & Fitness Value Added Course FY..Sports & Fitness Value Added Course FY..
Sports & Fitness Value Added Course FY..
 
Beyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global ImpactBeyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global Impact
 

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:  Mr.Akbarimanesh@gmail.com  Work EMail:  info@go-lang.ir
  • 30.  Golang English:  golang.org  Golang Persian:  go-lang.ir  Package Documentation:  golang.org/pkg  Golang Document:  golang.org/doc Thank you