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
PDF
Introduction to Go programming language
PPTX
Go Programming Language (Golang)
PDF
Golang and Eco-System Introduction / Overview
PPTX
Go Language Hands-on Workshop Material
PDF
FTD JVM Internals
PDF
Introduction to go language programming
PPTX
EuroPython 2016 - Do I Need To Switch To Golang
Go Lang Tutorial
Introduction to Go programming language
Go Programming Language (Golang)
Golang and Eco-System Introduction / Overview
Go Language Hands-on Workshop Material
FTD JVM Internals
Introduction to go language programming
EuroPython 2016 - Do I Need To Switch To Golang

What's hot (20)

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

Viewers also liked (8)

PDF
Golang #5: To Go or not to Go
PDF
Socket Programming In Python
PDF
Golang
PDF
Programming with Python and PostgreSQL
PDF
Programming with Python - Basic
PPTX
Write microservice in golang
PDF
Develop Android app using Golang
PDF
Functional programming in Python
Golang #5: To Go or not to Go
Socket Programming In Python
Golang
Programming with Python and PostgreSQL
Programming with Python - Basic
Write microservice in golang
Develop Android app using Golang
Functional programming in Python
Ad

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

PPTX
Golang basics for Java developers - Part 1
PDF
Go serving: Building server app with go
PDF
Let's golang
PDF
10〜30分で何となく分かるGo
PPTX
Go programming introduction
PDF
Coding in GO - GDG SL - NSBM
PPTX
Introduction to Go
PPTX
Lab2_AdvancedGoConceptswithgo_foundationofgolang_.pptx
PDF
Geeks Anonymes - Le langage Go
PDF
Golang 101
PDF
Introduction to Go for Java Programmers
PDF
Something about Golang
PDF
Golang workshop
PDF
Trivadis TechEvent 2016 Go - The Cloud Programming Language by Andija Sisko
PDF
Hello Go
PDF
A Tour of Go - Workshop
PDF
Python GTK (Hacking Camp)
PDF
Python-GTK
PDF
Go introduction
PDF
Learning go for perl programmers
Golang basics for Java developers - Part 1
Go serving: Building server app with go
Let's golang
10〜30分で何となく分かるGo
Go programming introduction
Coding in GO - GDG SL - NSBM
Introduction to Go
Lab2_AdvancedGoConceptswithgo_foundationofgolang_.pptx
Geeks Anonymes - Le langage Go
Golang 101
Introduction to Go for Java Programmers
Something about Golang
Golang workshop
Trivadis TechEvent 2016 Go - The Cloud Programming Language by Andija Sisko
Hello Go
A Tour of Go - Workshop
Python GTK (Hacking Camp)
Python-GTK
Go introduction
Learning go for perl programmers

Recently uploaded (20)

PDF
2.FourierTransform-ShortQuestionswithAnswers.pdf
PPTX
PPH.pptx obstetrics and gynecology in nursing
PPTX
human mycosis Human fungal infections are called human mycosis..pptx
PDF
O5-L3 Freight Transport Ops (International) V1.pdf
PPTX
Pharmacology of Heart Failure /Pharmacotherapy of CHF
PDF
RMMM.pdf make it easy to upload and study
PDF
The Lost Whites of Pakistan by Jahanzaib Mughal.pdf
PDF
Insiders guide to clinical Medicine.pdf
PDF
Classroom Observation Tools for Teachers
PDF
Chapter 2 Heredity, Prenatal Development, and Birth.pdf
PPTX
Cell Types and Its function , kingdom of life
PDF
Business Ethics Teaching Materials for college
PDF
BÀI TẬP BỔ TRỢ 4 KỸ NĂNG TIẾNG ANH 9 GLOBAL SUCCESS - CẢ NĂM - BÁM SÁT FORM Đ...
PDF
Supply Chain Operations Speaking Notes -ICLT Program
PPTX
Cell Structure & Organelles in detailed.
PPTX
Institutional Correction lecture only . . .
PDF
TR - Agricultural Crops Production NC III.pdf
PDF
Abdominal Access Techniques with Prof. Dr. R K Mishra
PDF
STATICS OF THE RIGID BODIES Hibbelers.pdf
PPTX
Renaissance Architecture: A Journey from Faith to Humanism
2.FourierTransform-ShortQuestionswithAnswers.pdf
PPH.pptx obstetrics and gynecology in nursing
human mycosis Human fungal infections are called human mycosis..pptx
O5-L3 Freight Transport Ops (International) V1.pdf
Pharmacology of Heart Failure /Pharmacotherapy of CHF
RMMM.pdf make it easy to upload and study
The Lost Whites of Pakistan by Jahanzaib Mughal.pdf
Insiders guide to clinical Medicine.pdf
Classroom Observation Tools for Teachers
Chapter 2 Heredity, Prenatal Development, and Birth.pdf
Cell Types and Its function , kingdom of life
Business Ethics Teaching Materials for college
BÀI TẬP BỔ TRỢ 4 KỸ NĂNG TIẾNG ANH 9 GLOBAL SUCCESS - CẢ NĂM - BÁM SÁT FORM Đ...
Supply Chain Operations Speaking Notes -ICLT Program
Cell Structure & Organelles in detailed.
Institutional Correction lecture only . . .
TR - Agricultural Crops Production NC III.pdf
Abdominal Access Techniques with Prof. Dr. R K Mishra
STATICS OF THE RIGID BODIES Hibbelers.pdf
Renaissance Architecture: A Journey from Faith to Humanism

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